def nCk(n, k):
    return fact(n)/(fact(k)*fact(n-k))
def fact(x):
    p = 1
    for i in range(x):
        p = p*(i+1)
    return p

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)
#    print(temp)
    ans=(ans*temp)%1000000007
print(int(ans%1000000007))