import numpy as np
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
N, M = map(int,input().split())
dv = 1000000007
a = [-1]
for i in range(M):
    a.append(int(input()))
# 不可能チェック
if M!=1:
    for i in range(M-1):
        if a[i+1]-a[i] == 1:
            print(0)
            exit()
b = []
amari = 1
dic = {}
for i in range(M):
    b.append(a[i+1]-a[i]-2)
b.append(N-a[M]-1)
for dist in b:
    if dist%2==0:
        dist = dist//2
        tmp = sum([cmb(dist+x,dist-x) for x in range(dist+1)])
        amari *= tmp % dv
        amari = amari % dv
    else:
        dist = dist//2
        tmp = sum([cmb(dist+x,dist-x-1) for x in range(dist)])
        amari *= tmp % dv
        amari = amari % dv
print(amari)
