from operator import mul
from functools import reduce

mod = 10 ** 9 + 7
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def pat(n):
  cnt = 0
  for i in range(n//2 + 1):
    cnt += int(combinations_count(n - i, i))
  return cnt

n, m = map(int, input().split())
a = []
start = 0
cnt = 1
for i in range(m):
  ko = int(input())
  end = ko - 1
  cnt = cnt * pat(end - start)
  start = ko + 1
cnt = cnt * pat(n - start)

print(cnt % mod)
  