N,M=map(int,input().split())
def k(n):
    if n==0 or n==1:
        return 1
    else:
        return n*k(n-1)

def c(M,x):
    return k(M-x)/(k(x)*k(M-2*x))

def f(N):
    i=N//2
    count=0
    while i>=0:
        count+=c(N,i)
        i-=1
    return count
p=0
C=[]
for i in range(M):
    a=int(input())
    C.append(f(a-p-1))
    p=a+1
C.append(f(N-p))
if 0 in C:
    print(0)
else:
    m=1
    for j in range(len(C)):
        m=m*C[j]
    print(int(m%1000000007))