import math
N,M = list(map(int,input().split()))
a = [-1]
for i in range(M):
    a.append(int(input()))
a.append(N+1)
b = []
c = []
fac_N =[1]
for i in range(M+1):
    b.append(a[i+1]-a[i]-2)
for i in range(1,max(b)+1):
    fac_N.append(fac_N[-1]*i)


for i in range(len(b)):
    counter= 0
    for num2 in range(b[i]//2+1):
        counter += fac_N[num2+(b[i]-2*num2)]//fac_N[num2]//fac_N[b[i]-2*num2]%1000000007
    c.append(counter)
ans = 1
for i in range(len(c)):
    ans *= c[i]%1000000007
print(ans%1000000007)
