from math import factorial
def c(n,k):
  a = factorial(n) // factorial(k) // factorial(n - k)
  return a
def num(k): # k段昇る場合の数
  l = k // 2
  r = 0
  for i in range(l+1):
    e = k-2*i
    r += c(e+i,i)
    if r >= mod:
      r %= mod
  return r
n,m=map(int,input().split())
mod = 10**9+7
a=[int(input()) for i in range(m)]
if len(a)>1:
  sa = [a[i+1]-a[i] for i in range(m-1)]
  if min(sa)<=1:
    print(0)
    exit()
  ans=(num(a[0]-1) % mod) * (num(n-1-a[-1]) % mod)
  for i in sa:
    ans *= num(i-2) % mod
    ans %= mod
  print(ans)
  exit()
elif len(a) == 1:
  ans=(num(a[0]-1) % mod) * (num(n-1-a[0]) % mod)
  print(ans % mod)
else:
  ans = num(n) % mod