import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    mod =10**9+7
    N,M = map(int,input().split())
    A =[]
    for _ in range(M):
        a = int(input())
        A.append(a)

    dp= [0]*(N+1)
    ds= [0]*(N+1)
    for j in A:
        ds[j] =1

    dp[0] =1
    if ds[1] ==0:
        dp[1] =1
    for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
    print(dp[N])





if __name__ == "__main__":
    main() import sys sys import math math def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    mod =10**9+7
    N,M = map(int,input().split())
    A =[]
    for _ in range(M):
        a = int(input())
        A.append(a)

    dp= [0]*(N+1)
    ds= [0]*(N+1)
    for j in A:
        ds[j] =1

    dp[0] =1
    if ds[1] ==0:
        dp[1] =1
    for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
    print(dp[N]) main mod =10**9+7 mod 10**9+7 10**9 10 9 7 N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M A =[] A [] for _ in range(M):
        a = int(input())
        A.append(a)

     _ range(M) range M a = int(input()) a int(input()) int input() input A.append(a) A.append A append a dp= [0]*(N+1) dp [0]*(N+1) [0] 0 N+1 N 1 ds= [0]*(N+1) ds [0]*(N+1) [0] 0 N+1 N 1 for j in A:
        ds[j] =1

     j A ds[j] =1 ds[j] ds j 1 dp[0] =1 dp[0] dp 0 1 if ds[1] ==0:
        dp[1] =1
     ds[1] ==0 ds[1] ds 1 0 dp[1] =1 dp[1] dp 1 1 for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
     i range(2,N+1) range 2 N+1 N 1 if ds[i] ==1:
            continue
         ds[i] ==1 ds[i] ds i 1 continue dp[i] = dp[i-1]+dp[i-2] dp[i] dp i dp[i-1]+dp[i-2] dp[i-1] dp i-1 i 1 dp[i-2] dp i-2 i 2 dp[i] %=mod dp[i] dp i mod print(dp[N]) print dp[N] dp N if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input def main():
    mod =10**9+7
    N,M = map(int,input().split())
    A =[]
    for _ in range(M):
        a = int(input())
        A.append(a)

    dp= [0]*(N+1)
    ds= [0]*(N+1)
    for j in A:
        ds[j] =1

    dp[0] =1
    if ds[1] ==0:
        dp[1] =1
    for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
    print(dp[N]) def main():
    mod =10**9+7
    N,M = map(int,input().split())
    A =[]
    for _ in range(M):
        a = int(input())
        A.append(a)

    dp= [0]*(N+1)
    ds= [0]*(N+1)
    for j in A:
        ds[j] =1

    dp[0] =1
    if ds[1] ==0:
        dp[1] =1
    for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
    print(dp[N]) main
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    mod =10**9+7
    N,M = map(int,input().split())
    A =[]
    for _ in range(M):
        a = int(input())
        A.append(a)

    dp= [0]*(N+1)
    ds= [0]*(N+1)
    for j in A:
        ds[j] =1

    dp[0] =1
    if ds[1] ==0:
        dp[1] =1
    for i in range(2,N+1):
        if ds[i] ==1:
            continue
        dp[i] = dp[i-1]+dp[i-2]
        dp[i] %=mod
    print(dp[N])





if __name__ == "__main__":
    main()
