def mul(c):
  ANS = 0
  for t, o in zip(range(c, -1, -1), range(0, 2*(c + 1), 2)):
    ans = 1
    for m in range(t + o, max(t, o), -1):
      ans *= m 
    ANS += ans
  return ANS
 
def mul_odd(c):
  ANS = 0
  for t, o in zip(range(c, -1, -1), range(1, 2*c + 3, 2)):
    ans = 1
    for m in range(t + o, max(t, o), -1):
      ans *= m 
    ANS += ans
  return ANS
 
N, M = map(int, input().split())
D = 0
A = [0]
ans = []
aans = 1
for i in range(M + 1):
  if i != M :
  	A.append(int(input()))
  else: 
    A.append(N + 1)
  diff = A[i + 1] - A[i]
  if (diff == 1) & (i != 0):
    print(0)
    D = 1
    break
  
  temp = diff -1
  if (temp) % 2 == 0:
    aans *= mul(temp//2)
  else:
    aans *= mul_odd(temp//2)
if D == 0:   
	print(aans % 1000000007)