import math
import functools
import operator


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

def combinations_count(n, r):
    if n -r >= 0:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0
    
def sum_comb(gap):
    if gap < 0:
        return 0
    elif gap < 2:
        return 1
    else:
        return sum([combinations_count(gap-i, i) for i in range(gap)])

combs = []
now = 0
for step in break_steps:
    gap = step - 1 - now
    combs.append(sum_comb(gap))
    now = step + 1
gap = n - now
combs.append(sum_comb(gap))
print(functools.reduce(operator.mul, combs) % 1000000007)