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