from math import factorial

N, M = map(int, input().split())
search_starts = [0]
search_ends = []
for _ in range(M):
    a_i = int(input())
    search_ends.append(a_i-1)
    search_starts.append(a_i+1)
search_ends.append(N)

all_patterns = 1
for start, end in zip(search_starts, search_ends):
    passdiff = end - start
    num_2 = passdiff // 2
    residue = passdiff % 2

    tmp_patterns_for_range = 0
    for num2to1 in range(num_2+1):
        add_n_1 = num2to1 * 2
        tmp_num2 = num_2 - num2to1
        tmp_n_pattern = \
            factorial(tmp_num2 + add_n_1 + residue) // factorial(tmp_num2) // factorial(add_n_1 + residue)
        tmp_patterns_for_range += tmp_n_pattern
    all_patterns *= tmp_patterns_for_range

print(all_patterns%1000000007)