N, M = map(int, input().split())
a = [0 for i in range(M)]
sosu = 10 ** 9 + 7
for i in range(M):
    a[i] = int(input())
dp = [0 for i in range(N+1)]
dp[0] = 1
for i in range(1, N+1):
    if i in a:
        pass
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % sosu
print(dp[N])