n,m = map(int,input().split())
A = [int(input()) for _ in range(m)]
mod = 1000000007
dp = [0]*(n+1)
dp[0],dp[1] = 1,1
for i in range(2,n+1):
    if i in A:
        continue
    elif i-1 in A and i-2 in A:
        dp[n] = 0
        break
    elif i-1 in A:
        dp[i] = dp[i-2]
    elif i-2 in A:
        dp[i] = dp[i-1]
    else:
        dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)