N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
A = set(A)

dp = [0] * N

ans = None

if N == 1:
  ans = 1

if N == 2:
  ans = 2 if 1 not in A else 1

if ans:
  print(ans)
  
dp[-1] = 1 if N-1 not in A else 0
dp[-2] = dp[-1] + 1 if N-2 not in A else dp[-1]

for i in range(N-3, -1, -1):
  if i not in A:
    dp[i] = dp[i+1] + dp[i+2]

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