n, m = (int(x) for x in input().split())
a = [0] * m
for i in range(m):
    a[i] = int(input())

dp = [0] * (n + 1)
mod = 1000000007
dp[0] = 1
j = 0
for i in range(1, n+1):
    if i == a[j]:
        dp[i] = 0
        if j != m - 1:
            j += 1
    elif i >= 2:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
    else:
        dp[i] = dp[i-1] % mod

print(dp[n])