n,m=map(int,input().split())
MOD=10**9+7
dp=[0]*(n+1)
a=[]
for i in range(m):
    tmp=int(input())
    a.append(tmp)
dp[0]=1
dp[1]=1
for i in range(2,n+1):
    if i-1 in a:
        if i-2 in a:
            print(0)
            exit()
        dp[i]=dp[i-2]
    elif i-2 in a:
        dp[i]=dp[i-1]
    else:
        dp[i]=(dp[i-1]+dp[i-2])%MOD
print(dp[-1])