#include <bits/stdc++.h>
using namespace std;
long long modpower(long long a, long long r, long long mod) {
  long long x = 1;
  a %= mod;
  while (r > 0) {
    if (r & 1) x = x * a % mod;
    r >>= 1;
    a = a * a % mod;
  }
  return x;
}
int main() {
  long double pi = 3.141592653589793238462643383;
  long double eps = 2e-16;
  long long mod = 1e9 + 7;
  int N;
  cin >> N;
  vector<long long> A(N), B(N);
  for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
  multiset<pair<long double, int>> mst;
  vector<bool> checked(N, false);
  long long ans = 1;
  long long zero = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] == 0 && B[i] == 0) {
      zero++;
      continue;
    }
    mst.insert({atan2((long double)A[i], (long double)B[i]), i});
  }
  while (!mst.empty()) {
    auto it = mst.begin();
    long double a = (*it).first;
    int i = (*it).second;
    long long cnt_a = 1, cnt_b = 0;
    mst.erase(it);
    it = mst.lower_bound({a, 0});
    while (it != mst.end() && (*it).first < a + eps) {
      int j = (*it).second;
      if (((A[i] % mod) * (B[j] % mod) - (B[i] % mod) * (A[j] % mod)) % mod !=
          0) {
        it++;
        continue;
      }
      cnt_a++;
      it = mst.erase(it);
    }
    it = mst.lower_bound({a + pi / 2, 0});
    while (it != mst.end() && (*it).first < a + pi / 2 + eps) {
      int j = (*it).second;
      if (((A[i] % mod) * (A[j] % mod) + (B[i] % mod) * (B[j] % mod)) % mod !=
          0) {
        it++;
        continue;
      }
      cnt_b++;
      it = mst.erase(it);
    }
    it = mst.lower_bound({a + pi, 0});
    while (it != mst.end() && (*it).first < a + pi + eps) {
      int j = (*it).second;
      if (((A[i] % mod) * (B[j] % mod) - (B[i] % mod) * (A[j] % mod)) % mod !=
          0) {
        it++;
        continue;
      }
      cnt_a++;
      it = mst.erase(it);
    }
    it = mst.lower_bound({a + pi * 3 / 2, 0});
    while (it != mst.end() && (*it).first < a + pi * 3 / 2 + eps) {
      int j = (*it).second;
      if (((A[i] % mod) * (A[j] % mod) + (B[i] % mod) * (B[j] % mod)) % mod !=
          0) {
        it++;
        continue;
      }
      cnt_b++;
      it = mst.erase(it);
    }
    it = mst.lower_bound({a + pi * 2, 0});
    while (it != mst.end() && (*it).first < a + pi * 2 + eps) {
      int j = (*it).second;
      if (((A[i] % mod) * (B[j] % mod) - (B[i] % mod) * (A[j] % mod)) % mod !=
          0) {
        it++;
        continue;
      }
      cnt_a++;
      it = mst.erase(it);
    }
    ans *= modpower(2, cnt_a, mod) + modpower(2, cnt_b, mod) - 1;
    ans %= mod;
  }
  cout << (ans + zero + mod - 1) % mod << endl;
  return 0;
}
