import numpy as np
import math
N,M = list(map(int,input().split()))
A = np.array([-1]+[int(input()) for _ in range(M)]+[N+1])
A = np.diff(A, n= 1)
cnt = 0
ans = 1
for d in A:
  d -= 2
  cnt = 0
  for j in range(d//2+1):
    cnt += math.factorial(d-j)//(math.factorial(d-j*2)*math.factorial(j))
  ans *= cnt
print(ans%1000000007)