import math
N,M = map(int,input().split())
a = []
flg = False

for i in range(M):
  a_ = int(input())
  a.append(a_)
  if a_ - a[i-1] == 1:
    flg = True

if flg == True:
  print(0)
else:
  before = 0
  ans = 1
  for i in a:
    step = i-before
    two = (step-1)//2
    p = 0
    if two < 1:
      p = 1
    else:
      for j in range(1,two+1):
        p += math.factorial(step-1-j)/math.factorial(j)/math.factorial(step-1-j-j)
      p += 1
      ans = ans * p
      ans = ans % 1000000007
      before = i
  step = N-before
  two = (step-1)//2
  p = 0
  if two < 1:
    p = 1
  else:
    for j in range(1,two+1):
      p += math.factorial(step-1-j)/math.factorial(j)/math.factorial(step-1-j-j)
    p += 1
  ans = ans * p
  ans = ans % 1000000007
  print(int(ans))
    
       
      