# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10000)

n, m = map(int, raw_input().split())
a_arr = []
count_sum = 0


for idx in range(0, m):
  a_arr.append(int(raw_input()))

from operator import mul
from functools import reduce

def cmb(n,r):
    # print(n, r)
    r = min(n-r,r)
    
    if r == 0:
      return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def calc_ans(a_len):

  b_max = a_len//2
  temp_sum = 0

  for idx_b in range(0, b_max + 1):
    idx_a = a_len - (idx_b * 2)

    print(a_len, idx_a, idx_b)

    total_num = idx_a + idx_b

    temp_sum += cmb(total_num, idx_a)
    print(a_len, idx_a, idx_b, total_num, cmb(total_num, idx_a))

  return temp_sum

ans_val = 1

for idx in range(0, len(a_arr)):
  if idx == 0:
    a_len = a_arr[0]
  elif idx < len(a_arr)-1:
    a_len = a_arr[idx] - a_arr[idx-1]
  else:
    a_len = n - a_arr[idx]
  
  
  temp_ans = calc_ans(a_len - 1)

  # print(a_len)
  # print(temp_ans)

  ans_val = ans_val * temp_ans

print(ans_val % 1000000007)
