import math
N,M = map(int, input().split())
def C(a,b):
    return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))
def pattern(n):
    ans = 0
    i = 0
    while n - 2*i >= 0:
        ans += C(n-i*2,i)
        i += 1
    return ans
ans = 1
mod = 10**9 + 7
l = [0 for i in  range(M)]
for i in range(1,M):
    l[i] = int(input()) - l[i-1] -2
if N-l[M-1]-2 >= 0:
    l.append(N-l[M-1]-2)
l.sort()
for i in range(len(l)):
    if i != 0 and l[i] == l[i-1]:
        ans *= tmp
    else:
        ans *= pattern(l[i])
    ans = ans%mod
    tmp = pattern(l[i])
print(int(ans))