#include <bits/stdc++.h>
using namespace std;
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
int main() {
  int N;
  cin >> N;
  map<long double, bool> used;
  map<long double, int> fish;
  map<long double, long double> opposite;
  vector<long double> keys;
  long long A, B;
  long long total = 1;
  long long MOD = 1000000007;
  for (int i = 0; i < N; i++) {
    cin >> A >> B;
    if (B < 0) {
      A *= -1;
      B *= -1;
    }
    fish[atan2(B, A)] += 1;
    keys.push_back(atan2(B, A));
    if (A >= 0) {
      opposite[atan2(B, A)] = atan2(A, -B);
    } else {
      opposite[atan2(B, A)] = atan2(-A, B);
    }
  }
  for (int i = 0; i < keys.size(); i++) {
    long double key = keys[i];
    if (used[key] == true) {
      continue;
    }
    long long multiple = 1;
    used[key] = true;
    long long temp = 1;
    for (int j = 0; j < fish[key]; j++) {
      temp *= 2;
      temp %= MOD;
    }
    multiple += temp - 1;
    if (fish[opposite[key]] != 0) {
      used[opposite[key]] = true;
      long long temp = 1;
      for (int j = 0; j < fish[opposite[key]]; j++) {
        temp *= 2;
        temp %= MOD;
      }
      multiple += temp - 1;
    }
    multiple %= MOD;
    total *= multiple;
    total %= MOD;
  }
  total += MOD - 1;
  total %= MOD;
  cout << total;
  return 0;
}
