import math


memo = [-1 for _ in range(1000000)]
def fact(n):
    if n == 0: return 1
    if memo[n] != -1: return memo[n]
    ret = n * fact(n-1)
    memo[n] = ret
    return ret

fact_mamo = [-1 for _ in range(1000000)]
def c(n, r):
    u = fact_mamo[n]
    if u == -1:
        u = fact(n)
        fact_mamo[n] = u

    d1 = fact_mamo[n-r]
    if d1 == -1:
        d1 = fact(n-r)
        fact_mamo[n-r] = d1

    d2 = fact_mamo[r]
    if d2 == -1:
        d2 = fact(r)
        fact_mamo[r] = d2

    d = d1*d2
    return u//d

def f(n):
    if n == 0: return 1
    ret = 0
    for i in range(n//2+1):
        ret += c(n-i, i)
    return ret



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

mod = 1000000007
if m == 0:
    print(f(n))
    exit()

ptn = f(a[0]-1)
for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        ptn = 0
        break
    ptn = (ptn * f(a[i+1]-1 - a[i]-1)) % mod
ptn = (ptn * f(n - a[len(a)-1]-1)) % mod

print(ptn)