from sys import exit
from math import factorial

N, M = map(int, input().split())
broken = [-1]
for i in range(M):
    broken.append(int(input()))
broken.append(N + 1)
ways = 1
for i in range(M + 1):
    interval = broken[i + 1] - broken[i]
    if i < M and interval == 1 and broken[i + 2] - broken[i + 1] == 1:
        print(0)
        exit()
    ways_ = 0
    if interval >= 2:
        for k in range((interval - 2) // 2 + 1):
            ways_ += (factorial(interval - 2 - k)) // (factorial(k) * factorial(interval - 2 - 2 * k))
        ways *= ways_
print(ways % (10 ** 9 + 7))