from sys import stdin
import numpy as np
from math import factorial
# 有理数型をインポート
from fractions import Fraction

# 組合せの総数
def comb(n, k, MOD=1):

    if n < 0 or k < 0:
        pdt = 0

    else:
        pdt = 1
        for s in range(1, k + 1):
            pdt *= Fraction(n - s + 1, s)

    # 戻り値をint型にするために分子を取り出す
    return pdt.numerator%MOD

N, M = [int(x) for x in stdin.readline().rstrip().split()]
MOD = 10**9+7

stairs = []
now = 0
for i in range(M):
    a = int(stdin.readline().rstrip().split()[0])
    stairs.append(a-1 - now)
    now = a+1
stairs.append(N-now)

def f(n):
    if n==0:
        return 1
    if n==-1:
        return 0
    ret = 1
    for i in range(1,int(n/2)+1):
        ret += comb((n-2*i+i),i, MOD)
    return ret%MOD
# print(stairs)

ans = 1
for s in stairs:
    #print("s =", s)
    ans *= f(s)
    ans %= MOD
print(ans)
