import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0] * (N+1)
mod = 10**9 + 7

for i in range(M):
    dp[a[i]] = -1

dp[0] = 1
if dp[1] != -1 and dp[2] != -1:
    dp[1] = 1
    dp[2] = dp[0] + dp[1]
elif dp[1] == -1 and dp[2] != -1:
    dp[2] = 1
elif dp[1] != -1 and dp[2] == -1:
    dp[1] = 1
else:
    print(0)
    exit()

for i in range(3, N+1):
    if dp[i] == -1:
        continue
    elif dp[i-1] == -1 and dp[i-2] != -1:
        dp[i] = dp[i-2]
    elif dp[i-1] != -1 and dp[i-2] == -1:
        dp[i] = dp[i-1]
    elif dp[i-1] != -1 and dp[i-2] != -1:
        dp[i] = dp[i-1] + dp[i-2]
    else:
        print(0)
        exit()

print(dp[N] % mod)