import functools
import operator

dic = {-1: 0, 0: 1, 1:1}

def pat(n):
  if n not in dic:
    dic[n] = pat(n-1) + pat(n-2)
  return dic[n]


import sys
n, m = map(int, input().split())
a = list(map(int, sys.stdin.readlines()))

s = 0
e = n
xs = [0] * (m + 1)
for i, j in enumerate(a):
  xs[i] = pat(j - s - 1)
  s = j + 1
xs[m] = pat(n - s)
if 0 in xs:
  print(0)
else:
  result = functools.reduce(operator.mul, xs)
  print(result % 1000000007)
