import itertools

n,m = map(int, input().split())

mlist = [int(input()) for i in range(m)]

past = -10
minus = 0

for i in mlist:
    if i == past+1 :
        print(0)
        quit()
    past = i

    if i ==1:
        minus += 1
    if i == n-1:
        miunus += 1

nopattern = len(mlist)*3 + minus
fig = n - nopattern

figlist=[]
for i in range(fig-1):
    figlist.append(i+1)

ans = 0

for i in range(fig-1):
    ans += (len(list(itertools.permutations(figlist, i+1))))

print(ans % 1000000007)

#    print(list(itertools.permutations(figlist, i+1)))