
import math


fact = {}


def calc(_n):
    _i = (_n - 1) // 2
    c = 0
    for j in range(_i+1):
        k1 = _n - 1 - j
        k2 = k1 - j
        if k1 not in fact:
            fact[k1] = math.factorial(k1)
        if j not in fact:
            fact[j] = math.factorial(j)
        if k2 not in fact:
            fact[k2] = math.factorial(k2)
        c += fact[k1] // (fact[j] * fact[k2])
    return c


n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))

b = 0
s = 1
for i in a:
    s *= calc(i-b)
    b = i + 1
if b != n:
    s *= calc(n+1-b)
print(s % 1000000007)
