N,M = map(int,input().split())

a = [int(input())-1 for _ in range(M)]
T = 1
for i in range(M-1):
    if a[i]+1==a[i+1]:
        T = 0
        break
if T == 0:
    print(0)
else:
    if N==1:
        print(0)
    else:
        L = [0 for _ in range(N)]
        for i in range(M):
            L[a[i]] = -1
        if L[0] == -1:
            L[1] = 1 
        else:
            L[0] = 1
            if L[1] != -1:
                L[1] = 2
        for i in range(2,N):
            if L[i] != -1:
                if L[i-2] == -1:
                    L[i] = L[i-1]%1000000007
                elif L[i-1] == -1:
                    L[i] = L[i-2]%1000000007
                else:
                    L[i] = (L[i-1]+L[i-2])%1000000007
        print(L)