N,M = map(int,input().split())
A = []
for i in range(M):
    A.append(int(input()))
if A[0] == 1 or A[0] == 2:
    B = [0]
else:
    B = [A[0]-1]
for j in range(M-1):
    B.append(A[j+1]-A[j]-2)
B.append(N-A[M-1]-1)
ans = 1
for p in range(M+1):
    if B[p] == -1:
        print(0)
        exit()
    elif B[p] == 0 or B[p] == 1:
        ans *= 1
    else:
        b = 0
        N = B[p]
        for v in range(N//2+1):
            a = 1
            for w in range(N-2*v+1,N-v+1):
                a *= w/(w-N+2*v)
            b += a
        ans *= b
        ans %= 1000000007
print(round(ans))