MOD=10**10+7
n,m = list(map(int, input().split()))
a = set([int(input()) for _ in range(m)])

dp = [0] * (n+1)

if 1 in a and 2 in a:
    print(0)
    exit()
elif 1 in a:
    dp[2]=1
    dp[3]=2
    start=4
elif 2 in a:
    dp[1]=1
    dp[3]=2
    start=4
else:
    dp[1]=1
    dp[2]=2
    start=3
    
for step in range(start, n+1):
    if dp[step-1]==0 and dp[step-2]==0:
        break
    if step not in a:
        dp[step] = (dp[step-1] + dp[step-2])%MOD
print(dp[-1])