from scipy.misc import comb as combination

N,M = map(int, input().split())
a = [int(input()) for _ in range(M)]
a.append(N+1)

if M != 1:
  for i in range(M-1):
    if a[i+1] - a[i] == 1:
      print(0)
      exit()

route = []
begin = 0
for i in range(M+1):
  stair = a[i]-1
  space = stair - begin
  flag = stair%2
  if flag == 0:
    comb = [j for j in range(0, space+1, 2)]
  else:
    comb = [j+1 for j in range(0, space+1, 2)]
  total = [combination((space-tmp)//2+tmp, tmp, exact=True) for tmp in comb]
  route.append(sum(total))
  begin = stair+2
ans = 1
for i in route:
	ans *= i  
print(ans%1000000007)