import math
def main():
  n, m = map(int,input().split())
  if m != 0:
    BStep = [int(input()) for _ in range(m)]
    sumstep = culc(0,BStep[0]-1)
    for i in range(1,m):
      sumstep*=culc(BStep[i-1]+1,BStep[i]-1)
    sumstep*=culc(BStep[m-1]+1,n)
  else:
    sumstep=culc(0,n)
  print(sumstep%1000000007)

def culc(fromstep,tostep):
  up = tostep - fromstep
  if up==0:
    ans = 1
  elif up<0:
    ans = 0
  else:
    stepsum = 0
    tsmax = up//2
    for i in range(tsmax+1):
      one = up - 2*i
      stepsum += math.factorial(one + i)//(math.factorial(one)*math.factorial(i))
      # print(" ",stepsum)
    ans = stepsum
  # print(ans)
  return ans


main()