output_description: Print the count modulo 1000000007.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 B_1
      :
      A_N B_N
attempt: mod = 1000000007
  N = int(input())
  p_p = []
  p_m = []
  m_p = []
  m_m = []
  z_z = []
  z_p = []
  z_m = []
  p_z = []
  m_z = []
  if N == 1:
      print(1)
  
  else:
      for _ in range(N):
          tmp = list(map(int, input().split()))
          if tmp[0] > 0:
              if tmp[1] > 0:
                  p_p.append(tmp)
              elif tmp[0] == 0:
                  p_z.append(tmp)
              else:
                  p_m.append(tmp)
          if tmp[0] == 0:
              if tmp[1] > 0:
                  z_p.append(tmp)
              elif tmp[0] == 0:
                  z_z.append(tmp)
              else:
                  z_m.append(tmp)
          if tmp[0] < 0:
              if tmp[1] > 0:
                  m_p.append(tmp)
              elif tmp[0] == 0:
                  m_z.append(tmp)
              else:
                  m_m.append(tmp)
  
      counter = 0
      counter += len(z_z) * (N - len(z_z))
      counter = counter % mod
      counter += (len(z_p) + len(z_m)) * (len(p_z) + len(m_z))
      counter = counter % mod
      for a in p_p:
          for b in p_m + m_p:
              if a[0] * b[0] + a[1] * b[1] == 0:
                  counter += 1
      counter = counter % mod
      for a in m_m:
          for b in p_m + m_p:
              if a[0] * b[0] + a[1] * b[1] == 0:
                  counter += 1
  
      counter = counter % mod
      all_num = (2**N - 1) % mod
      answer = (all_num - counter * (2 ** (N - 2))) % mod
  
      print(answer)
  
problem_description: Statement
  
  We have caught N sardines. The _deliciousness_ and _fragrantness_ of the i-th
  sardine is A_i and B_i, respectively.
  
  We will choose one or more of these sardines and put them into a cooler.
  However, two sardines on bad terms cannot be chosen at the same time.
  
  The i-th and j-th sardines (i \neq j) are on bad terms if and only if A_i
  \cdot A_j + B_i \cdot B_j = 0.
  
  In how many ways can we choose the set of sardines to put into the cooler?
  Since the count can be enormous, print it modulo 1000000007.
samples: [{"input": "3\n    1 2\n    -1 1\n    2 -1", "output": "5\n    \n\nThere are five ways to choose the set of sardines, as follows:\n\n  * The 1-st\n  * The 1-st and 2-nd\n  * The 2-nd\n  * The 2-nd and 3-rd\n  * The 3-rd\n\n* * *"}, {"input": "10\n    3 2\n    3 2\n    -1 1\n    2 -1\n    -3 -9\n    -8 12\n    7 7\n    8 1\n    8 2\n    8 4", "output": "479"}]