import scipy.misc as scm

N, M = list(map(int, input().split()))
A = [0]
for m in range(M):
  A.append(int(input()))
  if m != 0 and A[m] - A[m - 1] == 1:
    print(0)
    exit()
A.append(N)
ans = 1
for m in range(1, len(A)):
  n = A[m] - A[m - 1] - 1
  c = [scm.comb(n - k, k, exact=True) for k in range(n // 2 + 1)]
  ans *= sum(c)
print(ans % 1000000007)