from functools import lru_cache
 
n,m = map(int,input().split())
a = [-1]
for i in range(m):
  a.append(int(input()))
a.append(n+1)
  
@lru_cache(maxsize=1000)
def comb(n,k):
  m = 1
  if n<2*k:
    k = n-k
  for i in range(1,k+1):
    m = m*(n-i+1)/i
  return m
 
pat = 1
for i in range(m+1):
  step = a[i+1]-a[i]-2
  patj = 0
  if(step<0):
    pat = 0
    break
  for j in range(step//2+1):
    patj += comb(step-j,j)
  patj = int(patj%1000000007)
  pat = int(pat*patj%1000000007)
  
print(pat)