import math

N,M=map(int,input().split())
A=[]
result=1
judge_out=0


a0=0
a=0
stairs_start=0
stairs_end=0

for i in range(M):
    a=int(input())
    result_i=0

    if a!=1:
        if a-a0==1 or a==N:
            result=0

        if judge_out!=1:
            if i==0:
                stairs_start=0
            else:
                stairs_start=a0+1
            stairs_end=a-1
            target=stairs_end-stairs_start
            n=target//2
            for j in range(n+1):
                if j==n and target%2==0:
                    result_i+=1
                else:
                    result_i+=int(math.factorial(target-j)/(math.factorial(j)*math.factorial(target-2*j)))
            result=result*result_i
    a0=a

if stairs_start<N:
    result_i=0
    stairs_start=a0+1
    stairs_end=N
    target=stairs_end-stairs_start
    n=target//2
    for j in range(n+1):
        if j==n and target%2==0:
            result_i+=1
        else:
            result_i+=int(math.factorial(target-j)/(math.factorial(j)*math.factorial(target-2*j)))
    result=result*result_i

print(result%1000000007)