import math
import sys

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N, M = map(int, input().split())
portion = []
tmp = -1

if M == 0:
    portion.append(N)

for i in range(M):
    a = int(input())
    if a - tmp == 1:
        print(0)
        sys.exit()
    portion.append(a - tmp - 1)
    tmp = a
    if i == M-1:
        portion.append(N - a)

multi_move = 1
for i in range(len(portion)):
    tmp_portion = portion[i] - 1
    arrow2_num = tmp_portion // 2
    if tmp_portion == 0:
        continue
    elif tmp_portion % 2 == 0:
        move = 0
    else:
        move = 1
    for j in range(arrow2_num + 1):
        long_arrow = j
        short_arrow = tmp_portion - j*2
        move += comb(long_arrow + short_arrow, long_arrow)
    multi_move *= move
    multi_move = multi_move % 1000000007
print(multi_move)