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 = []
for i in range(M+1):
    b.append(a[i+1]-a[i]-2)
    for i in range(len(b)):
        counter= 0
        for num2 in range(b[i]//2+1):
            counter += math.factorial(num2+(b[i]-2*num2))//math.factorial(num2)//math.factorial(b[i]-2*num2)
    c.append(counter%1000000007)
ans = 1
for i in range(len(c)):
    ans *= c[i]
print(ans%1000000007)