from scipy.misc import comb
import numpy as np

n, m = input().split()
n = int(n)
m = int(m)
a = [int(input()) for _ in range(m)]


def get_comb(cur, x):
    """cur: current step / x: next obstacle"""
    if cur + 1 == x:
        return 1
    else:
        y1 = x - 1 - cur
        y2 = int(y1/2)
        z = 0
        for i in range(y2+1):
            z += comb(y1 - i, i, 1)
        return z


a.append(n+1)

i = 0
pos = []
broken = False
for j in range(m+1):
    if j < m and a[j] + 1 == a[j+1]:
        print(0)
        broken = True
        break
    hoge = get_comb(i, a[j])
    pos.append(hoge)
    i = a[j] + 1

if broken is False:
    c = int(np.prod(pos))
    print(c % 1000000007)