n, m = map(int, input().split())
a = [0]*m
for i in range(m):
    a[i] = int(input())
mod = 10**9 + 7

dp = [0]*(n+1)
dp[0] = 1
if a[0] != 1:
    dp[1] = 1
else:
    dp[1] = 0
for i in range(1, m):
    dp[a[i]] = -1
for i in range(n-1):
    if dp[i+2] == -1:
        dp[i+2] = 0
    elif dp[i+2] == 0:
        dp[i+2] = (dp[i+1] + dp[i]) % mod
print(dp[n] % mod)