def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n,m = map(int,input().split(' '))
a0 = -1
b = []
for q in range(m):
    a1 = int(input())
    if a1 == a0:
        continue
    else:
        b.append(a1-a0-2)
        a0 = a1
b.append(n-a1-1)
ans = 1
for b0 in b:
    if b0 == -1:
        ans = 0
        break
    i = 0
    ans0 = 0
    while i <= b0//2:
        ans0 += cmb(b0-i,i)
        i += 1
    ans *= ans0
mod = 1000000007
print(ans%mod)