import math
n, m = map(int, input().split())
a = [0] + [int(input()) for _ in range(m)] + [n]

ans = 1
for i in range(m + 1):
    if i == 0 and i == m:
        ra = a[i+1] - a[i]
    elif i == 0 or i == m:
        ra = a[i+1] - a[i] - 1
    else:
        ra = a[i+1] - a[i] - 2

    if ra < 0:
        if i == 0 or i == m:
            continue
        else:
            ans = 0
            break
    elif ra == 0 or ra == 1:
        continue
    else:
        aaa = 1
        for n in range(1, ra // 2 + 1):
            length = ra - (2 * n) + n
            aaa += math.factorial(length) // (math.factorial(length - n) * math.factorial(n))
        ans *= aaa

print(ans % 1000000007)