def nCk(n, k):
    return bunshi(n,k)/bunbo(k)
def bunshi(n,k):
    p = 1
    for i in range(k):
        p = p*(n-i)
    return p%1000000007
def bunbo(k):
    p = 1
    for i in range(k):
        p = p*(i+1)
    return p%1000000007
    

N, M = map(int,input().split())
a=[-1]
for i in range(M):
    a.append(int(input()))
a.append(N+1)
#print(a)
D=[]
for i in range(M+1):
    D.append((a[i+1]-1)-(a[i]+1))
#print(D)

ans=1
for i in range(len(D)):
    temp = 0
    for j in range(D[i]//2+1):
        temp += ((nCk(D[i]-j,j))%1000000007)
    ans=(ans%1000000007)*(temp%1000000007)
print(int(ans%1000000007))