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

for i in range(N):
    if (i + 1) in a:
        dp[i] = 0
    elif i == 0:
        dp[i] = 1
    elif i == 1 and dp[0] == 1:
        dp[i] = 2
    elif i == 1 and dp[0] == 0:
        dp[i] = 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N-1] % MOD)
