N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
dp=[0]*N
id=0
p=10**9+7
point=a[id]
for i in range(N):
    if i==0:
        if a[id]!=(i+1):
            dp[i]=1
        else:
            id=id+1
    elif i==1:
        if a[id]!=(i+1):
            dp[i]=dp[i-1]+1
        else:
            id=id+1
    else:
        dp[i]=dp[i-1]+dp[i-2]
        if a[id]==i+1:
            dp[i]=0
            if id<len(a)-1:
                id=id+1
print(dp[N-1]%p)



