N,M = map(int,input().split())
a = [int(input()) 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(1)
    elif N == 2:
        print(2)
    else:
        L = [0 for _ in range(N)]
        if 0 in a:
            L[0] = 0
            L[1] = 1 
        else:
            L[0] = 1
            if 1 in a:
                L[1] = 0
            else:
                L[1] = 2
        for i in range(2,N):
            S = i-2 in a
            T = i-1 in a
            U = i in a
            if U:
                L[i] = 0
            elif T:
                L[i] = L[i-2]%1000000007
            else:
                if S:
                    L[i] = L[i-1]%1000000007
                else:
                    L[i] = (L[i-1]+L[i-2])%1000000007
    print(L[-1])