#include <bits/stdc++.h>
using namespace std;
using P = pair<long double, long double>;
int main() {
  int N;
  cin >> N;
  vector<P> A(N);
  for (int i = 0; i < N; i++) cin >> A[i].first >> A[i].second;
  map<double, int> B;
  for (int i = 0; i < N; i++) {
    double x = atanl(A.at(i).second / A.at(i).first);
    if (x < 0) {
      x = 3.141592653589793 / 2 + x;
    }
    B[fmod(x, (3.141592653589793 / 2))]++;
  }
  int ans = 1;
  for (auto y : B) {
    ans *= (y.second + 1) % 1000000007;
    ans % 1000000007;
  }
  cout << ans - 1 << endl;
}
