n,m=map(int,input().split())
a=[-1]
ans=0

for i in range(m):
    b=int(input())
    if a[i]==b-1:
        ans=1
        print(0)
    a.append(b)

a.append(n+1)



#k段を上る上り方を数える
#１段上るをi回、２段上るをj回
def cases(k):
    sum=0
    for j in range(k//2+1):
        i=k-2*j
        s=1
        if j>=1:
            for l in range(i+1,i+j+1):
                s=s*l
            for p in range(1,j+1):
                s=s/p
        sum+=int(s)
    return sum

counter=1
if ans==0:
    for x in range(m+1):
        y=cases(a[x+1]-a[x]-2)
        counter=counter*y
    print(counter%1000000007)
