import math

n, m = map(int, input().split())
li = [int(input()) for _ in range(m)]
li.append(n+1)
ans_li=[1 for i in range(m+1)]

def counter( start, end):
    one = end-start
    two = 0
    count = 0
    while 1:
        if one < 0:
            return max(count, 1)
        count+= (math.factorial(one+two)// (math.factorial(two)*math.factorial(one)))
        one -= 2
        two += 1

start_pos = 0
for i in range(0, m+1):
    if start_pos > li[i]-1:
        ans_li[i] = 0
        break
    ans_li[i] = counter(start_pos, li[i]-1)
    start_pos = li[i]+1

ans = 1
for i in ans_li:
    ans *=i
print(ans%(10**9+7))