import sys
import math

nm=list(map(int,input().split()))
N=nm[0]
M=nm[1]

A=[]
at=0
for i in range(M):
    a=int(input())
    if ((a-at)==1)& (a!=1):
        print(0)
        sys.exit()
    A.append(a)
    at=a

at=-1
np=1
for a in A:
    n=0
    ad=a-at-2
    q,mod=divmod(ad,2)
    #print('ad , q = {},{}'.format(ad,q))
    for i in range(q+1):
        c1=q-i
        c2=int(mod+2*i)
        #print(c1,c2)
        nt=int(math.factorial(c1+c2)/(math.factorial(c1)*math.factorial(c2)))
        n+=nt
    #print(n)
    np=np*n
    at=a

ad=N-at-1
q,mod=divmod(ad,2)
#print('ad , q = {},{}'.format(ad,q))  
n=0
for i in range(q+1):
    c1=q-i
    c2=int(mod+2*i)
    #print(c1,c2)
    nt=int(math.factorial(c1+c2)/(math.factorial(c1)*math.factorial(c2)))
    n+=nt
#print(n)
np=n*np

#print(int(np))
print(int(np%1000000007))
