n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
a.insert(0,0)
a.append(n)
b=[a[i+1]-a[i] for i in range(m+1)]
ans=1
z=[1,2]
for i in range(10**5):
    z.append(z[i]+z[i+1])
for i in b:
    if i!=0:
        ans =ans*z[i-1]
    if i==0:
        ans=0
print(ans%1000000007)  