N, M = map(int, input().split())
a = [int(input()) for i in range(M)]
n = 1
a.insert(0, -1)
a.append(N + 1)

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

def v(x):
    if x == -1:
        return 1
    else:
        q = x // 2
        r = x % 2
        ans = 0
        for i in range(x // 2 + 1):
            ans += cmb(q + r, r)
            r = r + 2
            q = q - 1
        return ans
for i in range(M + 1):
    if a[i + 1] - a[i] == 1:
        print(0)
        exit()

for i in range(M + 1):
    n *= v((a[i + 1] - 1) - (a[i] + 1))  % 1000000007

print(n)