import math
import sys

n, m = map(int, input().split())
a_list = [-1]
for _ in range(m):
    a_list.append(int(input()))
a_list.append(n + 1)

memo = dict()
ans = 1
for i in range(1, len(a_list)):
    sub = a_list[i] - a_list[i-1] - 1
    if sub == 0:
        print(0)
        sys.exit()
    if sub <= 2:
        continue
    sub -= 1
    if sub in memo.keys():
        ans *= memo[sub]
        continue
    count = 0
    for j in range(sub // 2 + 1):
        count += math.factorial(sub - j) // math.factorial(j) // math.factorial(sub - j * 2)
    memo[sub] = count
    ans *= count
print(ans % 1000000007)
