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: import math
  
  
  def m(L):
      (a, b) = L
      g = math.gcd(a, b)
  
      if b == 0:
          return (1, 0)
      elif b > 0:
          return (a // g, b // g)
      else:
          return (-a // g, -b // g)
  
  
  def w(x, y):
      if x == 0:
          return 2**y
      elif y == 0:
          return 2**x
      else:
          return 2**x + 2**y - 1
  
  
  N = int(input())
  D = []
  for i in range(N):
      (A, B) = map(int, input().split())
      D.append((A, B))
  
  O = 0
  for u in range(N):
      if D[u] == (0, 0):
          D.remove((0, 0))
          O = 1
  
  M = list(map(m, D))
  
  J = {}
  
  for m in M:
      if m in J:
          J[m] += 1
      else:
          J[m] = 1
  
  K = {}
  for u in J:
      (a, b) = u
      p = J[u]
  
      if a >= 0:
          (c, d) = (-b, a)
      else:
          (c, d) = (b, -a)
  
      f = True
      if (a, b) in K:
          (x, y) = K[(a, b)]
          if a >= 0:
              x += p
          else:
              y += p
          K[(a, b)] = (x, y)
          f = False
  
      elif f and ((c, d) in K):
          (x, y) = K[(c, d)]
          if c <= 0:
              x += p
          else:
              y += p
          K[(c, d)] = (x, y)
          f = False
  
      elif f:
          if a >= 0:
              K[(a, b)] = (p, 0)
          else:
              K[(a, b)] = (0, p)
  
  G = [w(x, y) for (x, y) in K.values()]
  
  r = 1
  V = 1000000007
  
  for g in G:
      r = (r * g) % V
  
  print(r - 1 + O)
  
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"}]