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

broken = [0] * N
for i in range(M):
    broken[int(input())] = 1


dp = [0] * (N + 1)
dp[N-1] = dp[N] = 1
for i in reversed(range(N-1)):
    if broken[i]:
        dp[i] = 0
        continue
    dp[i] = dp[i+1] + dp[i+2]

print(dp[0] % MOD)
