import sys
import math

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

pre_a = None
for _ in range(M):
    a = int(input())
    if pre_a is not None and a - pre_a < 2:
        print(0)
        sys.exit()
    pre_a = a
    a_list.append(a)

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

answer %= 1000000007
print(answer)
