MOD = 10**9 + 7
N, M = map(int,input().split())
a = set(int(input()) for _ in range(M))
dp = [0] * N
if 1 not in a:
    dp[0] = 1
    if 2 not in a:
        dp[1] = 2
else:
    if 2 not in a:
        dp[1] = 1

for i in range(2, N):
    if i+1 not in a:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[-1])
