import math

MOD = 10 ** 9 + 7

N, M = map(int, input().split())
a = [-1] + [int(input()) for i in range(M)] + [N + 1]

c = {}
def nCr(n, r):
    if (n, r) in c:
        return c[(n, r)]
    a = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    c[(n, r)] = a
    return a

d = {}
def step(n):
    if n in d:
        return d[n]
    a = 0
    for k in range(n // 2 + 1):
        a += nCr(n - k, k)
    d[n] = a
    return a

ans = 1
for i in range(M + 1):
    n = a[i + 1] - a[i] - 2
    if n < 0:
        ans = 0
    else:
        ans *= step(n)
        ans %= MOD
print(ans)
