N, M = map(int, input().split())
a = [int(input()) for _ in range(M)] 

P = [-1] * (N+1)
P[0] = 1
P[1] = 1
flg=False
MOD = 10**9 + 7
for i in range(2, N+1):
    if i in a:
        continue
    if (i-1 not in a) and (i-2 not in a):
        P[i] = (P[i-1] + P[i-2]) % MOD
    elif i-1 not in a:
        P[i] = P[i-1] % MOD
    elif i-2 not in a:
        P[i] = P[i-2] % MOD
    else:
        flg=True
if flg:
    print(0)
else:
    print(P[N] % MOD)