n,m=map(int,input().split())
l=[-1]
from math import factorial
for i in range(m):
  l.append(int(input()))
l.append(n+1)
ans=1
is_False=0
for i in range(m+1):
  if l[i+1]-l[i]<2:
    is_False+=1
  elif l[i+1]-l[i]>=2:
    a,s=l[i+1]-l[i]-2,0
    for n in range(a//2+1):
      s+=factorial(a-n)/(factorial(n)*factorial(a-2*n))
    ans*=s
    ans=ans%1000000007
print(ans if is_False==0 else 0)