import math

def c(n, r):
    u = math.factorial(n)
    d = math.factorial(n-r) * math.factorial(r)
    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)