import sys
sys.setrecursionlimit(10**6)

from collections import deque
N, M  = map(int, input().split())

#A = [int(input()) for i in range(M)]
A = deque()
for i in range(M):
  A.append(int(input()))


A.append(10005)

dp = [1]
for _ in range(N+1):
  dp.append(0)

#N段目まで行くのにdp[N]通り

s = 0
for i in range(N):
  if A[s] != i:
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
  else:
    dp[i] = 0
    s += 1

print(dp[N]%(10**9+7))