MOD = 10**9+7
memo = {}
def steps(n):
  if not(n in memo):
    if n == 0:
      memo[n] = 1
    elif n == 1:
      memo[n] = 1
    else:
      memo[n] = (steps(n-1)+steps(n-2))%MOD
  return memo[n]

N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
nowstep = 0
ans = 1
for a in A:
  if nowstep == a:
    ans = 0
    break
  ans = (ans * steps(a-1-nowstep))%MOD
  nowstep = a+1
ans = (ans * steps(N-nowstep))%MOD
print(ans)

