# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy
import itertools
from math import factorial

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

div_num  = 1000000007

N, M=map(int, input().split())

dmg = [int(input()) for _ in range(M)]

for i in range(M - 1):
    # 連番なら終了
    if dmg[i] + 1 == (dmg[i + 1]):
        print(0)
        exit()

comb_list = []
start = 0
for i in range(len(dmg) + 1):
    if i == len(dmg):
        interval = N - start
    else:
        interval = (dmg[i] - 1) - start
    j = 0
    comb_sum = 0
    while True:
        if (2 * j) > interval:
            break
        num_ptn_1_2 = j + (interval - (2 * j))
        r = j
        #comb_sum += int(factorial(num_ptn_1_2) / factorial(r) / factorial(num_ptn_1_2 - r))
        comb_sum += cmb(num_ptn_1_2,r)
        j += 1
    if i < len(dmg):
        # 壊れた階段の次を始点にする
        start = dmg[i] + 1
    comb_list.append(comb_sum)

result = 1

for elem in comb_list:
    result *= elem

print(result % div_num)