import math
import numpy as np

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

diff = np.array(A)[1:] - np.array(A)[:-1]
if any(diff == 1) :
    print(0)
else :
    S = []
    A.insert(0, 0)
    A.insert(N-1, N)
    #print(A)
    D = list(np.array(A)[1:] - np.array(A)[:-1])
    for d in range(1, len(D) - 1) :
        D[d] -= 1
    R = []
    #print(D)
    for d in D :
        P = d - 1
        K = int(P / 2)
        T = 1
        for k in range(1, K+1) :
            T += combinations_count(P - k, k)
        R.append(T)
    ans = R[0]
    #print(R)
    for r in R[1:] :
        #print(ans)
        ans = ans * r % (10 ** 9 + 7)
    print(ans)

