import math


def combi(a, b):
    ans = math.factorial(a) / (math.factorial(a - b) * math.factorial(b))
    ans=int(ans)
    return ans

N,M=map(int,input().split())

mod=10**9+7

if N==1:
    print(1)
    exit()

if M==0:
    a=N-1

a0=-1
cnt=[]
for i in range(M):
    a=int(input())
    n=(a-1)-(a0+1)
    if a-a0==1:
        print(0)
        exit()
    c=0
    for k in range(n // 2 + 1):
        c += combi(n - k, k) % mod
    cnt.append(c)
    a0=a

a = N+1
n = (a - 1) - (a0 + 1)
c = 0
for k in range(n // 2 + 1):
    c += combi(n - k, k) % mod
cnt.append(c)

ans=1
for i in range(len(cnt)):
    ans*=cnt[i]
    ans=ans%mod

print(ans)


