n,m = map(int,input().split())
a = [0]
lim = int((1e+9)+7)
def combination(n,k):
    ans = 1
    for i in range(k):
        ans = (ans*(n-i))
        ans = (ans/(i+1))
    return int(ans)

def stair(num):
    ans = 0
    for i in range(num):
        ans = (ans+combination(num-i,i))%lim
    return int(ans)

for _ in range(m):
    a.append(int(input()))
a.append(n+1)
d = []
for i in range(m+1):
    d.append(a[i+1]-a[i])
d[0] += 1
for i in range(len(d)):
    if not(i == 0 or i == len(d)-1):
        if d[i] == 1:
            print(0)
            exit()
ansf = 1
for i in range(1,len(d)):
    if d[i] != 1:
        ansf = (ansf * stair(d[i]-2))%lim
print(ansf%lim)