from math import factorial
def comb(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

t=list(map(int, input().split()))
N=int(t[0])
M=int(t[1])
a=[-1]
for i in range(M):
        a.append(int(input()))
a.append(N+1)
d=1
for i in range(M+1):
        b=a[i+1]-a[i]-1
        c=0
        if (b==0):c=0
        else:
                for j in range(int((b-1)/2)+1):
                        c = c + int(comb((b-1-j),j))
                        c = c%1000000007
        d = d*c
        d = d%1000000007
print(d)
