import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N,M = [int(i) for i in input().split()]
A = [0]
for _ in range(M):
    A.append(int(input()))
A.append(N)
ans = 1
for n in range(len(A)):
    if n ==0:
        pass
    else:
        div = (A[n]-A[n-1]-1) // 2
        mod = (A[n]-A[n-1]-1) % 2
        div_mod = div+mod
        comb = 0
        for _ in range(div):
            comb += combinations_count(div_mod,div)
            div_mod += 1
            div -=1
            if div == 0:
                div = 1
                div_mod = 1
        comb += combinations_count(div_mod,div)
        ans = (ans * comb) % 1000000007
print(ans)