N, M = map(int, input().split())
mod = 1e+9+7
flags = [True  for i in range(N)]
for i in range(M):
    tmp = int(input())
    flags[tmp-1] = False
dp = [0 for i in range(N)]
dp[0] = 1
dp[1] = 2

if not flags[0]:
    dp[0] = 0
    dp[1] = 1
if not flags[1]:
    dp[1] = 0
for i in range(2, N):
    if flags[i]:
        dp[i] = int((dp[i-1] + dp[i-2]) % mod)
print(dp)
    