import math
import sys
import itertools

N, M = map(int, sys.stdin.readline().split())

mod_num = 1000000007

if M == 0:
    roop_time = math.floor(N/2)
    var_sum = 0
    for i in range(1, roop_time + 1):
        var_sum += len(list(itertools.combinations(range(N - i), i)))
    ans = var_sum + 1
    print(ans)
    sys.exit()

a = []
for i in range(M):
    a.append(int(sys.stdin.readline()))

for i in range(M):
    if i == 0:
        continue
    if (a[i] - a[i-1]) == 1:
        ans = 0
        print(ans)
        sys.exit()

section_N = []
temp = 0
for i in range(M):
    section_N.append(a[i] - temp - 1)
    temp = a[i]
section_N.append(N - temp - 1)


combinations = []
for i in range(len(section_N)):
    if section_N[i] == 1 or section_N[i] == 0:
        continue
    roop_time = math.floor(section_N[i]/2)
    var_sum = 0
    for j in range(1, roop_time + 1):
        var_sum += len(list(itertools.combinations(range(section_N[i] - j), j)))
    combinations.append(var_sum + 1)

ans = 1
for i in range(len(combinations)):
    ans = (ans * combinations[i])%mod_num
print(ans)