N, M = map(int, input().split())
MOD = 10 ** 9 + 7

a = [int(input()) for _ in range(M)]

dp = [0 for _ in range(N + 1)]
dp[0] = 1

for now in range(N):
    for next in range(now + 1, min(N + 1, now + 3)):
        if next not in a:
            dp[next] += dp[now]
            dp[next] = dp[next] % MOD

print(dp[N])
