N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
Mod = 1000000007
dp = [0]*(N+1) #dp[i]...i番目にいる時の移動方法の数
dp[0] = 1

count = 0
for i in range(1,N):
    if i in a:
        count += 1
        if count == 2:
            print(0)
            exit()
    else:
        count = 0
    
if 1 in a:
    dp[2] = 1
    for i in range(1,N-1):
        dp[i+2] = dp[i+1] + dp[i]
        if i+2 in a:
            dp[i+2] = 0
else:
    dp[1] = 1
    for i in range(N-1):
        dp[i+2] = dp[i+1] + dp[i]
        if i+2 in a:
            dp[i+2] = 0
print(dp[N]%Mod)