# 3
memo=dict()
def combi_memorized(n, k):
    if k * 2 > n:
        k = n - k
    if k == 0:
        return 1
    if k == 1:
        return n
    memo_key = (n, k)
    if (n, k) not in memo:
        memo[memo_key] = combi_memorized(n-1, k) + combi_memorized(n-1, k-1)
    return memo[memo_key]

import sys
sys.setrecursionlimit(10000)
N, M = (int(x) for x in sys.stdin.readline().split(' '))
a_list = [int(x) for x in sys.stdin.readlines()]

tmp_list = []
tmp_list.append(a_list[0]-1 - 0)
for i in range(1, M):
    tmp_list.append(a_list[i] - a_list[i-1]-1)
tmp_list.append(N - a_list[-1]-1)

if 0 in tmp_list[1:]:
    print(0)
    exit()
s = 0
for v in tmp_list:
    for i in range(v):
        s += combi_memorized(v-i, i)
        if s > 1000000007:
            s -= 1000000007
print(s)