#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const long long mod = 1000000007;
const long long INF = 1e15;
const double PI = 3.1415926535897932;
const double LIT = 0.000000001;
vector<long long> dx = {1, 0, -1, 0};
vector<long long> dy = {0, 1, 0, -1};
int main() {
  long long N;
  cin >> N;
  vector<double> d;
  for (int i = (int)0; i < (int)N; i++) {
    double x, y;
    cin >> x >> y;
    if (x == 0)
      d.push_back(PI / 2);
    else
      d.push_back(atan(y / x));
  }
  sort(d.begin(), d.end());
  vector<bool> used(N, false);
  long long ans = 1;
  for (int i = (int)0; i < (int)N; i++) {
    if (used[i]) continue;
    double a = d[i] + PI / 2;
    long long j, p, q;
    j = upper_bound(d.begin(), d.end(), d[i] + LIT) - d.begin();
    p = lower_bound(d.begin(), d.end(), a - LIT) - d.begin();
    q = upper_bound(d.begin(), d.end(), a + LIT) - d.begin();
    long long K = (1 << (j - i));
    if (p == q)
      ans = (ans * K) % mod;
    else {
      K += (1 << (q - p));
      K--;
      ans = (ans * K) % mod;
    }
    for (int t = (int)i; t < (int)j; t++) used[t] = true;
    for (int t = (int)p; t < (int)q; t++) used[t] = true;
  }
  cout << ans - 1 << endl;
}
