import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

N, M = LI()
A = []
for i in range(M):
    A.append(_I())

"""
飛び越える前までの道筋の通りを調べてかけていく
"""

if M != 0:
    # 連続した壊れた段がある場合は0
    B = [i for i in A]
    B.remove(B[0])
    B.append(10**15)
    diffs = [b - a for a, b in zip(A,B)]
    #  print(diffs)

    if any(i == 1 for i in diffs):
        # 隣同士なので0
        print(0)
        exit()

# 隣り合うものがないので、各区間の通りを出していく
res = [0 for _ in range(N)]
memo = {}
for aidx in range(len(A)+1):
    if aidx == 0:
        start = 0
    else:
        start = A[aidx-1] + 1

    if aidx == len(A):
        # last item
        end = N
    else:
        end = A[aidx] - 1
    #ぐうきで分ける、一箇所を2とびにした場合、2箇所を2とびにした場合などで変える
    r = end - start
    if r in memo.keys():
        res[aidx] += memo[r]
        continue
    max_2_steps = r // 2
    #  print('ma', max_2_steps)
    for i in range(max_2_steps + 1):
        tmp = r
        tmp -= 2 * i
        #  print('i,r,tmp', i, r, tmp)
        # tmpが1段ずつになる
        res[aidx] += int(math.factorial(i + tmp) / (math.factorial(tmp) * math.factorial(i)))
        memo[r] = int(math.factorial(i + tmp) / (math.factorial(tmp) * math.factorial(i)))

#  print(res)
ans = 0
for r in res:
    if r == 0:
        continue
    if ans == 0:
        ans = r
    else:
        ans *= r
print(ans % mod)
