from operator import mul
from functools import reduce
import math


def cmb(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 stair_cmb(step, memo):
    try:
        return memo[step]
    except KeyError:
        sm = 0
        r = 0
        for n in range(step, math.ceil(step / 2) - 1, -1):
            sm = sm + cmb(n, r)
            r = r + 1
        return sm


cache = {}
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(int(input()))
current = 0
ans = 0
for a in A:
    if current == a:
        print(0)
        exit()
    stp = a - current - 1
    if stp == 0:
        current = current + 2
    elif stp == 1:
        current = current + 3
    else:
        if ans == 0:
            ans = stair_cmb(stp, cache)
        else:
            ans = ans * stair_cmb(stp, cache)
        current = a + 1

stp = N - current
if stp == 0:
    pass
elif stp == 1:
    pass
else:
    ans = ans * stair_cmb(stp, cache)
ans = ans % 1000000007

print(ans)
