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

mod = 1000000007

dp = [0 for _ in range(N + 1)]
dp[0] = 1
if 1 not in A:
    dp[1] = 1

for n in range(2, N + 1):
    if n in A:
        dp[n] = 0
    else:
        dp[n] = dp[n - 1] + dp[n - 2]
        if dp[n] >= mod:
            dp[n] -= mod
            
print(dp[N])
