N, M = map(int, input().split())


a = [True] * (N)
for _ in range(M):
    a[int(input())-1] = False


mod = 10**9 + 7
dp = [0] * (N)
dp[0] = (1 if a[0] else 0)

if N == 1:
    print(dp[0])
    exit(0)

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

print(dp[N-1])
