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

mod = 10**9+7
dp = [0] * N

if 1 not in A:
    dp[0] = 1
    if (2 not in A) and N > 1:
        dp[1] = 2
elif N > 1:
    if 2 not in A:
        dp[1] = 1
    else:
        dp[1] = 0

for i in range(2, N):
    if i+1 not in A:
        #dp[i] = (dp[i-2] + dp[i-1]) % mod
        dp[i] = (sum(dp[i-2:i])) % mod

print(dp[N-1])