def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def pattcount(num):
    if(num == 0): return 1
    if(num < 0): return 0
    result = 1
    ranmax = num // 2 + 1
    for i in range(1, ranmax):
        result += cmb(num-i, i)
    
    return result
    

if __name__ == '__main__':
    n,m = list(map(int, input().split()))

    pattern = 1
    step = 0
    for i in range(m):
        a = int(input())
        pattern *= pattcount(a - 1 - step)
        step = a + 1

    pattern *= pattcount(n - step)

    print(pattern % 1000000007)
