n,m=map(int,input().split())

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

if m!=0:
    a = [int(input()) for i in range(m)]
    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]
 
else:
    for i in range(n-1):
        dp[i+2]=dp[i+1]+dp[i]


print(dp[n]%(1000000007))