n, m = map(int, input().split())
a = []
for i in range(m):
  a.append(int(input()))
# 0: 1, 1: 1, 2: 2(1+1, 2), 3: 3(1+1+1, 1+2, 2+1)
# dp[i] = dp[i-1] + dp[i-2]
dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
  if i not in a:
    dp[i+1] += dp[i]
    dp[i+1] %= 10**9+7
    if i+2 != n+1:
      dp[i+2] += dp[i]
      dp[i+2] %= 10**9+7
print(dp[n])