N, M = map(int,input().split())
A = [int(input()) for k in range(M)]
dp = [0 for k in range(N+1)]
MOD = 10**9+7

dp[0] = 1
dp[1] = 1
dp[2] = 1

t = 0
if A[0] == 1:
    t += 1
    dp[1] = 0

for k in range(2,N+1):
    if t < len(A) and A[t] == k:
        dp[k] = 0
        t += 1
    else:
        dp[k] = dp[k-1] + dp[k-2]
        dp[k] %= MOD
print(dp[N])
