MOD = 10 ** 9 + 7  # prime number
 
def cmb(n, r, mod=MOD):
    if r < 0 or n < r:
        return 0
    r = min(r, n-r)
    numerator, denominator = 1, 1
    for i in range(1, r + 1):
        numerator = (numerator * (n + 1 - i)) % mod
        denominator = (denominator * i) % mod
    return numerator * pow(denominator, mod - 2, mod) % mod

N,M = map(int,input().split())
ans = 1
broken = [-1]
for i in range(M):
  K = int(input())
  broken.append(K)
broken.append(N+1)
for j in range(len(broken)-1):
  pattern = 0
  step = broken[j+1]-broken[j]-2
  step_pattern = step//2
  for k in range(step_pattern+1):
    pattern += cmb(step-k,k)
  ans = ans*pattern
print(ans%(10**9+7))