N,M=map(int,input().split())
mod=1000000007
f=[False]*(N+1)
for _ in range(M):
    i=int(input())
    f[i]=True
dp=[0 for _ in range(N+1)]

if f[1] and f[2]:
    print(0)
    exit()
elif f[1]:
    dp[1]=0;dp[2]=1
elif f[2]:
    dp[1]=1;dp[2]=0
else:
    dp[1]=1;dp[2]=2

for i in range(3,N+1):
    if f[i]:
        dp[i]=0
    else:
        dp[i]=dp[i-1]+dp[i-2]
print(dp[N]%mod)