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

if any([abs(A[i+1] - A[i] == 1) for i in range(len(A)-1)]):
  print(0)
  exit()

mod = pow(10, 9) + 7
dp = [0] * (N+1+2)
dp[0] = 1
if 1 not in A:
  dp[1] = 1
  
for i in range(2, N+1):
  if i not in A:
    if i-1 not in A:
      dp[i] = (dp[i] + dp[i-1]) % mod
    if i-2 not in A:
      dp[i] = (dp[i] + dp[i-2]) % mod
print(dp[N])