# -*- coding: utf-8 -*-
import sys

N, M = map(int, input().split())
a = [int(input()) for x in range(M)]

def calc_routes(dan):
    tmp = 1
    for i in range(int(dan/2)):
        i += 1
        n = dan - i
        tmp2 = 1
        for j in range(i):
            tmp2 *= n - j
        for j in range(i):
            tmp2 /= j + 1
        tmp += tmp2

    return tmp

routes = 1
prev = 0
for x in a:
    if x - prev == 0:
        routes = 0
        break
    else:
        x -= 1
        dan = x - prev
        routes = (routes * calc_routes(dan)) % 1000000007
        prev = x+2

routes = (routes * calc_routes(N-prev)) % 1000000007
print(int(routes))