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

dp=[0]*(n+1)
dp[0]=1
if not(1 in a):
    dp[1]=1

    

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

print(dp[n])