N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10**9+7
DP = [0] * (N + 2)
DP[0] = 1
for i in range(0, N):
  if i in A:
    continue
  if not i + 1 in A:
    DP[i + 1] += DP[i]
  if not i + 2 in A:
    DP[i + 2] += DP[i]

print(DP[N]%mod)