import operator as op
from functools import reduce
import sys
input = sys.stdin.readline

def ncr(n, r):
  r = min(r, n-r)
  numer = reduce(op.mul, range(n, n-r, -1), 1)
  denom = reduce(op.mul, range(1, r+1), 1)
  return numer // denom

def climbStairs(n):
  #if n == 0:
  #  return 0
  
  c = 0
  for i in range(n//2+1):
    c += ncr(i+n-2*i, i)
  return int(c)

n, m = map(int, input().split())

stairs = []
c = 0
for _ in range(m):
  broken = int(input())
  stairs.append(broken - c - 1)
  c = broken + 1

if c != n:
  stairs.append(n - c)

print(reduce(op.mul, map(climbStairs ,stairs), 1)%1000000007)

