# DP
mod = 10 ** 9 + 7
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

safe = [True] * (N+1)
for i in range(M):
    safe[A[i]] = False 

dp = [0] * (N+1)
dp[0] = 0
dp[1] = 1
dp[2] = 2
if 1 in A:
    dp[1] = 0
    dp[2] = 1
if 2 in A:
    dp[2] = 0

for i in range(3, N+1):
    if safe[i]:
        dp[i] = dp[i-1] + dp[i-2]

##print(dp)
print((dp[N]+mod)%mod)