from math import factorial
MOD = 1000000007

def calc_nCr(n, r):
    return (int(factorial(n) / (factorial(r) * factorial(n - r)))) % MOD
def count_patterns(stairs):
    if stairs == 0 or stairs == 1:
        return 1
    max_double_num = int(stairs/2)
    combs = [None]*(max_double_num+1)
    for i in range(max_double_num+1):
        double = i
        single = stairs - double*2
        n = double + single
        r = double
        nCr = calc_nCr(n, r)
        combs[i] = nCr
    return sum(combs) % MOD
  
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

def main():
    now = 0
    total = 1
    for broken in a:
        if broken <= now:
            print(0)
            break
        total = (total * count_patterns(broken-now-1)) % MOD
        now = broken + 1
    else:
        total = (total * count_patterns(N-now)) % MOD
        print(total)
main()