import math
# input
stairs, broken = map(int, input().split())
broken_list = []
for i in range(broken):
  broken_list.append(int(input()))
  
# main
goalable = True
for i in range(1, broken):
  if broken_list[i-1] == broken_list[i]-1:
    goalable = False
    break

if goalable:
  broken_list.append(stairs+1)
  now = 0
  ans_list = []
  for b in broken_list:
    cp = b - 1
    stg = cp - now
    tmp = 0
    
    if stg != 0:
      for x in range(stg+1):
        if (stg - x) % 2 == 0:
          y = (stg - x) // 2
          tmp += math.factorial(x+y) // (math.factorial(x) * math.factorial(y))
      ans_list.append(tmp)
    else:
      ans_list.append(1)
    now = b + 1
  
  ans = 1
  for i in ans_list:
    ans = (i * ans) % 1000000007
  print(ans)
else:
  print(0)

