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 sys
  
  INF = 1 << 60
  MOD = 10**9 + 7  # 998244353
  sys.setrecursionlimit(2147483647)
  input = lambda: sys.stdin.readline().rstrip()
  from cmath import phase
  from math import gcd
  from collections import Counter
  
  
  def resolve():
      n = int(input())
      zero = 0
      counter = Counter()
      for _ in range(n):
          x, y = map(int, input().split())
          # eliminate 0 vector
          if x == 0 and y == 0:
              zero += 1
              continue
          # standardize (0 <= arg(z) < pi)
          g = gcd(x, y)
          x //= g
          y //= g
          if y < 0:
              x *= -1
              y *= -1
          elif y == 0:
              x, y = 1, 0
          counter[complex(x, y)] += 1
  
      k = len(counter)
      C = list(counter.items())
      C.sort(key=lambda tup: phase(tup[0]))
      vector = [tup[0] for tup in C]
      count = [tup[1] for tup in C]
  
      res = 0
      dp = [0] * (k + 1)
      dp[0] = 1
      for i in range(k):
          z = vector[i]
          vert = z.imag - z.real * 1j
          dp[i + 1] += dp[i]
          dp[i + 1] += (
              (pow(2, count[i], MOD) - 1)
              * dp[i]
              * pow(2, -counter[vert] % (MOD - 1), MOD)
          )
          dp[i + 1] %= MOD
  
      res = dp[k]
      res -= 1
      res += zero
      assert zero > 0
      print(res % MOD)
  
  
  resolve()
  
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"}]