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

dp = [0] * (n + 1)
if 0 not in a:
    dp[0] = 1
if 1 not in a:
    dp[1] = 1
if 2 not in a and n >= 2:
    if 1 in a:
        dp[2] = 1
    else:
        dp[2] = 2
if (n >= 10**4):
    exit()

mod = 10**9+7

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

print(dp[-1])
