import math

def comb(a, b):
    return math.factorial(a) // (math.factorial(b) * math.factorial(a - b))

n, m = map(int, input().split())
ans = 1
p = 0
for _ in range(m):
    a = int(input())
    cnt = 0
    if a == p:
        print(0)
        exit()
    s = a - 1 - p
    for i in range(s // 2 + 1):
        cnt += comb(s - i, i)
    p = a + 1
    ans = (ans * cnt) % (10 ** 9 + 7)
s = n - p
cnt = 0
for i in range(s // 2 + 1):
    cnt += comb(s - i, i)
ans = (ans * cnt) % (10 ** 9 + 7)
print(ans)
