def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n,m=map(int,input().split())
a=[-1]
ans=1
flg=0
for i in range(m):
    a.append(int(input()))
a.append(n+1)

for i in range(len(a)-1):
    k=a[i+1]-a[i]-2
    b=0
    tmp=0
    if k==-1 and i!=0:
        flg=1
        break
    while k-2*b>=0:
        c=k-2*b
        tmp+=cmb(c+b,c)
        b+=1
    if tmp!=0:
        ans*=tmp
        
ans=ans%(10**9+7)

if flg==0:
    print(ans)
else:
    print(0)