output_description: Print the number of the different orders in which the N robots can finish the
  race, modulo 10^9+7.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      x_1 x_2 ... x_N
attempt: N = int(input())
  A = [[0 if x == "." else 1 for x in input()] for i in range(N)]
  
  if sum([sum(x) for x in A]) == 0:
      print(-1)
  else:
      sum_list = [0] * N
      for i in range(N):
          s = 0
          for j in range(N):
              s += A[j][i]
          sum_list[i] = s
  
      count = N
      index = []
      flag2 = True
      for i in range(N):
          tmp = 0
          id = []
          flag1 = True
          for j in range(N):
              if A[i][j] == 1:
                  continue
              elif sum_list[i] > 0:
                  tmp += 1
                  id.append(j)
              else:
                  flag1 = False
                  break
  
          if flag1:
              flag2 = False
              if tmp <= count:
                  count = tmp
                  index = id
  
          if count == 0:
              break
  
      if flag2:
          print(-1)
      else:
          result = 2 * count
          print(count, index)
          for i in range(N):
              if i not in index and sum_list[i] != N:
                  result += 1
  
          print(result)
  
problem_description: Statement
  
  You are developing frog-shaped robots, and decided to race them against each
  other.
  
  First, you placed N robots onto a number line. These robots are numbered 1
  through N. The current coordinate of robot i is x_i. Here, all x_i are
  integers, and 0 < x_1 < x_2 < ... < x_N.
  
  You will repeatedly perform the following operation:
  
    * Select a robot on the number line. Let the coordinate of the robot be x. Select the destination coordinate, either x-1 or x-2, that is not occupied by another robot. The robot now jumps to the selected coordinate.
  
  When the coordinate of a robot becomes 0 or less, the robot is considered
  finished and will be removed from the number line immediately. You will repeat
  the operation until all the robots finish the race.
  
  Depending on your choice in the operation, the N robots can finish the race in
  different orders. In how many different orders can the N robots finish the
  race? Find the answer modulo 10^9+7.
samples: [{"input": "3\n    1 2 3", "output": "4\n    \n\nThere are four different orders in which the three robots can finish the race:\n\n  * (Robot 1 \u2192 Robot 2 \u2192 Robot 3)\n  * (Robot 1 \u2192 Robot 3 \u2192 Robot 2)\n  * (Robot 2 \u2192 Robot 1 \u2192 Robot 3)\n  * (Robot 2 \u2192 Robot 3 \u2192 Robot 1)\n\n* * *"}, {"input": "3\n    2 3 4", "output": "6\n    \n\nThere are six different orders in which the three robots can finish the race:\n\n  * (Robot 1 \u2192 Robot 2 \u2192 Robot 3)\n  * (Robot 1 \u2192 Robot 3 \u2192 Robot 2)\n  * (Robot 2 \u2192 Robot 1 \u2192 Robot 3)\n  * (Robot 2 \u2192 Robot 3 \u2192 Robot 1)\n  * (Robot 3 \u2192 Robot 1 \u2192 Robot 2)\n  * (Robot 3 \u2192 Robot 2 \u2192 Robot 1)\n\nFor example, the order (Robot 3 \u2192 Robot 2 \u2192 Robot 1) can be achieved as shown\nin the figure below:\n\n![a55aed48a00614569d4844f39807e2fb.png](https://atcoder.jp/img/mujin/a55aed48a00614569d4844f39807e2fb.png)\n\n* * *"}, {"input": "8\n    1 2 3 5 7 11 13 17", "output": "10080\n    \n\n* * *"}, {"input": "13\n    4 6 8 9 10 12 14 15 16 18 20 21 22", "output": "311014372\n    \n\nRemember to print the answer modulo 10^9+7. This case is not included in the\ntest set for the partial score."}]