import numpy as np
MOD = 1000000007
def F(n):
  root = np.sqrt(5)
  return max(1,int(1/root * (((1+root)/2)**n - ((1-root)/2)**n)))

n,m = map(int, input().split())
a = [0] + [int(input()) for _ in range(m)] + [n]
dif = [0]*(m+1)
for i in range(m+1):
  dif[i] = a[i+1] - a[i] - 1
if 0 in dif:
  print(0)
else:
  dif[-1] += 1
  print(np.mod(np.prod(list(map(F,dif))),MOD))