import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r)*math.factorial(r))

n,m=[int(i) for i in input().split()]
a1=[int(input()) for i in range(m)]
a1.append(n+1)
c1=1
a2=0
for i in range(m+1):
    a3=a1[i]-1-a2
    a4=a3//2
    c2=0
    c3=1
    for j in range(0,a4+1):
        c3=combinations_count(a3-j,j)
        c2+=c3
        #print(c3)
    #print(c2)
    c1=c1*c2%(1000000007)
    a2=a1[i]+1
    if c1==0:
        break



print(c1)
