from math import factorial
N,M=map(int,input().split())
list1=[]
ANS=0
for i in range(M):
  A=int(input())
  list1+=[A]
  if i>=1:
    DAN=A-list1[i-1]-1
    B=DAN-DAN//2
    if A==list1[i-1] or A==list1[i-1]+1:
      print(0)
      break
    for k in range(B):
      a = factorial(B) / factorial(k) / factorial(B - k)
      ANS+=a
  else:
    DAN=A
    B=DAN-DAN//2
    for k in range(B):
      a = factorial(B) / factorial(k) / factorial(B - k)
      ANS+=a
DAN=N-A-1
B=DAN-DAN//2
for t in range(B):
  a = factorial(B) / factorial(t) / factorial(B - t)
  ANS+=a
print(int(ANS)%1000000007)