output_description: Print the number of the combinations of exits that can be used by the robots
  when all the robots disappear, modulo 10^9 + 7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      x_1 x_2 ... x_N
      y_1 y_2 ... y_M
attempt: import bisect
  
  r_n, e_n = map(int, input().split())
  robot = list(map(int, input().split()))
  exit = list(map(int, input().split()))
  
  dict = []
  for r in robot:
      i = bisect.bisect(exit, r)
      if i == 0 or i == e_n:
          continue
      left = exit[i - 1]
      right = exit[i]
      dict.append([r - left, right - r])
  
  dict.sort()
  
  
  def check(dict):
      if len(dict) <= 1:
          if len(dict) == 0:
              return 1
          else:
              return 2
  
      result = 0
  
      left = dict[0][0]
      count = 1
      while True:
          if count == len(dict) or dict[count][0] > left:
              break
          else:
              count += 1
      result += check(dict[count:])
  
      right = dict[0][1]
      new_dict = []
      for d in dict:
          if d[1] > right:
              new_dict.append(d)
      result += check(new_dict)
  
      return result
  
  
  print(check(dict))
  
problem_description: Statement
  
  There are N robots and M exits on a number line. The N + M coordinates of
  these are all integers and all distinct. For each i (1 \leq i \leq N), the
  coordinate of the i-th robot from the left is x_i. Also, for each j (1 \leq j
  \leq M), the coordinate of the j-th exit from the left is y_j.
  
  Snuke can repeatedly perform the following two kinds of operations in any
  order to move all the robots simultaneously:
  
    * Increment the coordinates of all the robots on the number line by 1.
    * Decrement the coordinates of all the robots on the number line by 1.
  
  Each robot will disappear from the number line when its position coincides
  with that of an exit, going through that exit. Snuke will continue performing
  operations until all the robots disappear.
  
  When all the robots disappear, how many combinations of exits can be used by
  the robots? Find the count modulo 10^9 + 7. Here, two combinations of exits
  are considered different when there is a robot that used different exits in
  those two combinations.
samples: [{"input": "2 2\n    2 3\n    1 4", "output": "3\n    \n\nThe i-th robot from the left will be called Robot i, and the j-th exit from\nthe left will be called Exit j. There are three possible combinations of exits\n(the exit used by Robot 1, the exit used by Robot 2) as follows:\n\n  * (Exit 1, Exit 1)\n  * (Exit 1, Exit 2)\n  * (Exit 2, Exit 2)\n\n* * *"}, {"input": "3 4\n    2 5 10\n    1 3 7 13", "output": "8\n    \n\nThe exit for each robot can be chosen independently, so there are 2^3 = 8\npossible combinations of exits.\n\n* * *"}, {"input": "4 1\n    1 2 4 5\n    3", "output": "1\n    \n\nEvery robot uses Exit 1.\n\n* * *"}, {"input": "4 5\n    2 5 7 11\n    1 3 6 9 13", "output": "6\n    \n\n* * *"}, {"input": "10 10\n    4 13 15 18 19 20 21 22 25 27\n    1 5 11 12 14 16 23 26 29 30", "output": "22"}]