import sys

n,m = map(int, input().split())
a = [int(input()) for i in range(m)]
a.append(n)
a.insert(0, 0)

def nCr(n, r):
  num = 1
  for i in range(r+1, n+1):
    num *= i
  return num


P = 1
for i in range(m):
  if a[i] + 1 == a[i+1]:
    print(0)
    sys.exit()

for i in range(1, m+2):
  step = a[i] - a[i-1] - 1
  pattern = 1
  for j in range(1, int(step/2+1)):
    pattern += nCr(step-j, j)
  P *= pattern 

print(P%1000000007)