import numpy as np
import math
MOD = 1000000007

def a1b2(a, b):
    return ((math.factorial(a+b)) // (math.factorial(a) * math.factorial(b)))

def houhou(first, second):
    sa = second-first
    sum = 0
    for b in range((sa // 2)+1):
        a = sa - 2*b
        sum += a1b2(a, b)
        sum = sum % MOD

    return sum

a = input().split()
dan_num = int(a[0])
hole_num = int(a[1])
areas =[[0, None]]
holes = []
hole = None
before_hole = None
shippai = False
for i in range(hole_num):
    hole = int(input())
    areas[i][1] = hole-1
    areas.append([hole + 1, None])
    if before_hole == (hole -1) :
        shippai = True
    before_hole = hole
areas[-1][1] = dan_num

ways = 1
if dan_num == 1:
    print(1)
elif shippai:
    print(0)
else:
    for area in areas:
        ways *= houhou(area[0], area[1])
        ways = ways % MOD
    print(ways)