output_description: Print the number of the possible orders in which they were standing, modulo
  10^9+7.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 ... A_N
attempt: n = int(input())
  a = [int(i) for i in input().split()]
  
  # aの各数値の個数をdictで保持(数値:個数) 
  a_dict = {}
  for v in a:
      if v in a_dict:
          a_dict[v] += 1
      else:
          a_dict[v] = 1
  
  # a_dictの中になければならない数値のリストを作成
  possible_list = {i: True for i in range(1, n, 2)}
   
  can = True
  if n % 2 == 0:
      for k, v in a_dict.items():
          # 数値が2個でない、もしくはkがpossible_list内に存在しないならFalse
          if v != 2 or k not in possible_list:
              can = False
              break
  else:
  　　　　if a_dict[0] != 1:
          can = False
      else:
          for k, v in a_dict.items():
              if v != 2 or k not in possible_list:
                  can = False
                  break
   
  if can:
      print(2 ** (n // 2) % (10 ** 9 + 7))
  else:
      print(0)
problem_description: Statement
  
  There are N people, conveniently numbered 1 through N. They were standing in a
  row yesterday, but now they are unsure of the order in which they were
  standing. However, each person remembered the following fact: the absolute
  difference of the number of the people who were standing to the left of that
  person, and the number of the people who were standing to the right of that
  person. According to their reports, the difference above for person i is A_i.
  
  Based on these reports, find the number of the possible orders in which they
  were standing. Since it can be extremely large, print the answer modulo
  10^9+7. Note that the reports may be incorrect and thus there may be no
  consistent order. In such a case, print 0.
samples: [{"input": "5\n    2 4 4 0 2", "output": "4\n    \n\nThere are four possible orders, as follows:\n\n  * 2,1,4,5,3\n  * 2,5,4,1,3\n  * 3,1,4,5,2\n  * 3,5,4,1,2\n\n* * *"}, {"input": "7\n    6 4 0 2 4 0 2", "output": "0\n    \n\nAny order would be inconsistent with the reports, thus the answer is 0.\n\n* * *"}, {"input": "8\n    7 5 1 1 7 3 5 3", "output": "16"}]