n, m = map(int, input().split())
a = []
dp = [0]
mod = 10**9+7

for i in range(m):
    a.append(int(input()))

if 1 in a and 2 in a:
    dp.append(0)
    dp.append(0)
elif 1 in a and 2 not in a:
    dp.append(0)
    dp.append(1)
elif 1 not in a and 2 in a:
    dp.append(1)
    dp.append(0)
else:
    dp.append(1)
    dp.append(2)

for i in range(3, n+1):
    if i in a:
        dp.append(0)
    else:
        dp.append((dp[i-1] + dp[i-2]) % mod)

print(dp[n])




