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

dp=[0]*(n+1)
dp[0]=1
if a[0]!=1:
    dp[1]=1
else:
    dp[1]=0
    cnt+=1

for i in range(n-1):
    if a[cnt]==i+2:
        dp[i+2]=0
        if cnt!=(m-1):
            cnt+=1
    else:
        dp[i+2]=(dp[i+1]+dp[i])%1000000007

print(dp[n]%1000000007)
