
import math


def calc(_n):
    _i = (_n - 1) // 2
    c = 0
    for j in range(_i+1):
        c += math.factorial(_n-1-j) // (math.factorial(j) * math.factorial(_n - 1 - j*2))
    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)
