from functools import reduce

def fib_memo(n):
  memo = [0]*(n+1)
  def _fib(n):
    if n <= 1:
      return n
    if memo[n] != 0:
      return memo[n]
    memo[n] = _fib(n-1) + _fib(n-2)
    return memo[n]
  return _fib(n)

N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
B = [0]*(M + 1)
for i in range(M+1):
  if i == 0:
    diff = A[i] - 1
    B[0] = fib_memo(diff + 1)
  elif i == M:
    diff = N - A[M - 1] - 1
    B[M] = fib_memo(diff + 1)
  else:
    diff = A[i] - A[i-1] - 2
    if diff == 1:
      B[i] = 0
      break
    B[i] = fib_memo(diff + 1)
Ans = reduce(lambda a, b: a*b, B)
print(Ans % 1000000007)