#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const long long INF = 1e15 + 10;
const long long mod = 1e9 + 7;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
vector<double> theta;
int N;
long long powx[200001], A[200001], B[200001];
int get_num(double x) {
  return upper_bound(theta.begin(), theta.end(), x + EPS) -
         lower_bound(theta.begin(), theta.end(), x - EPS);
}
int main() {
  cin >> N;
  int ng = 0;
  for (int i = 0; i < N; i++) {
    long long a, b;
    cin >> a >> b;
    A[i] = a, B[i] = b;
    if (a == 0 && b == 0) {
      ng++;
    } else {
      if (a == 0) {
        theta.push_back(PI / 2.0);
      } else {
        theta.push_back(atan(b / (double)a));
      }
    }
  }
  sort(theta.begin(), theta.end());
  N -= ng;
  powx[0] = 1;
  for (int i = 0; i < N; i++) powx[i + 1] = powx[i] * 2 % mod;
  long long ans = 1;
  for (int i = 0; i < theta.size(); i++) {
    double x = theta[i];
    int ng = get_num(x - PI / 2.0);
    if (!ng) {
      int minus = get_num(x + PI / 2.0);
      int plus = 1;
      while (i < theta.size() - 1 && theta[i + 1] <= x + EPS) i++, plus++;
      long long tmp = (powx[plus] + powx[minus] - 1) % mod;
      (ans *= tmp) %= mod;
    }
  }
  cout << (ans + mod + ng - 1) % mod;
  return 0;
}
