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

dp = [0] * 10010
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(N):
    if i+2 in A:
        continue
    dp[i+2] = dp[i] + dp[i+1]

print(dp[N] % 1000000007)