import math
n, m = map(int, input().split())
now_step = 0
checked_steps = {}
factorial_dict = {}
divide_num = 1000000007 

def count_steps(number):
    global checked_steps
    global factorial_dict
    if(number in checked_steps.keys()):
        return checked_steps[number]
    # count=1*a+2*bとなるような、0以上の全てのa,bについて、1をa個、2をb個並べる並べ方を返す.
    # [1,(a+b)]からa個を選ぶ選び方と同じ
    # 余り残は和・積に関して分割法則が成り立つので1,000,000,007 で割ってもいい
    counter = 0
    for i in range(0, number + 1, 2):
        a = number - i
        b = i // 2
        if((a+b) not in factorial_dict):
            factorial_dict[a+b] = math.factorial(a+b)
        if(a not in factorial_dict):
            factorial_dict[a] = math.factorial(a)
        if(b not in factorial_dict):
            factorial_dict[b] = math.factorial(b)
        counter += factorial_dict[a+b] // (factorial_dict[a] * factorial_dict[b])
    checked_steps[number] = counter % divide_num
    return checked_steps[number]

all_count = 1
for i in range(m):
    a = int(input())
    all_count = (all_count * count_steps(a - 1 - now_step)) % divide_num
    now_step = a + 1
all_count = (all_count * count_steps(n - now_step)) % divide_num
print(all_count % divide_num)