import math

N, M = list(map(int, input().split()))
a_list = list()

for _ in range(M):
    a_list.append(int(input()))

a_list.append(N + 1)
start_step = 0
end_step = 0
answer = 1
for a in a_list:
    p = 0
    end_step = a - 1
    diff = end_step - start_step
    for x in range(diff // 2 + 1):
        p += math.factorial(diff - x) // math.factorial(x) // math.factorial(diff - 2 * x)
    answer *= p
    start_step = a + 1

for i in range(len(a_list) - 1):
    if a_list[i + 1] - a_list[i] < 2:
        answer = 0
        break

answer %= 1000000007
print(answer)
