n,m = map(int,input().split())
ai = [int(input()) for i in range(m)]

mod = 10**9+7

dp = [0] * (n+1)
dp[0] = 1
num = 0

for i in range(1,n+1):
    #print(i)
    if i == ai[num]:
        dp[i] = 0
        num += 1
        num = min(num,len(ai)-1)
    else:
        if i == 1:
            dp[i] = dp[i-1] % mod
        else:
            dp[i] = (dp[i-1] + dp[i-2])%mod
#    dp[i+1] = dp[i-1] + dp[i]
            
print(dp[n]%mod)