import math

# N段の階段 M数の壊れてた床
N, M = map(int, input().split())
bar = 1000000007

bf_arr = []
for _ in range(M):
    l = int(input())
    bf_arr.append(l)

bf_arr.append(N + 1)

bf_cnt_arr = []

for i in range(M+1):
    if i == 0:
        bf = bf_arr[i]-1
    else:
        bf = bf_arr[i] - bf_arr[i-1] - 2

    if bf < 0:
        bf_cnt_arr.append(0)
        break
    n1 = bf
    n2 = 0
    denominator = math.factorial(bf)
    bf_cnt = 0
    while n1 >= 0:
        cnt = int(math.factorial(n1 + n2) /
                  (math.factorial(n1) * math.factorial(n2)))
        bf_cnt += cnt
        n1 -= 2
        n2 += 1
    bf_cnt_arr.append(bf_cnt)

final = 1

for i in bf_cnt_arr:
    final *= i

print(final % bar)
