n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
ok=[True]*(n+1)
for i in a:
    ok[i]=False

dp[0]=1
mod=10**9+7
for now in range(n):
    for next in range(now+1,min(n+1,now+3)):
        if ok[next]:
            dp[next]+=dp[now]
            dp[next]%mod

print(dp[n]%mod)
