#include <bits/stdc++.h>
using namespace std;
long long int n;
pair<long long int, long long int> ab[200200];
long long int b[200200];
inline bool ct(map<long double, long long int>& cnt, long double x) {
  auto it = cnt.lower_bound(x);
  if (abs(it->first - x) < 1e-12l) {
    return true;
  }
  if (it == cnt.begin()) {
    return false;
  }
  it--;
  if (abs(it->first - x) < 1e-12l) {
    return true;
  }
  return false;
}
int main() {
  cin >> n;
  for (long long int i = 0; i < ((long long int)(n)); i++) {
    cin >> ab[i].first >> ab[i].second;
  }
  b[0] = 1;
  for (long long int i = (long long int)(1); i < ((long long int)(200200));
       i++) {
    b[i] = (b[i - 1] * 2) % 1000000007;
  }
  map<long double, long long int> cnt;
  long long int zero = 0;
  for (long long int i = 0; i < ((long long int)(n)); i++) {
    if (ab[i].first == 0 && ab[i].second == 0) {
      zero++;
    } else {
      if (ab[i].second == 0) {
        cnt[3.141592653589793238462643383279 / 2.0l]++;
      } else {
        cnt[atan(ab[i].first * 1.0l / ab[i].second)]++;
      }
    }
  }
  long long int res = 1;
  for (auto&& kv : cnt) {
    if (kv.first >= 0 &&
        ct(cnt, kv.first - 3.141592653589793238462643383279 / 2)) {
      res = res *
            (b[kv.second] +
             b[cnt[kv.first - 3.141592653589793238462643383279 / 2.0l]] - 1) %
            1000000007;
    } else if (kv.first < 0 &&
               ct(cnt, kv.first + 3.141592653589793238462643383279 / 2.0l)) {
      continue;
    } else {
      res = res * b[kv.second] % 1000000007;
    }
  }
  cout << res - 1 + zero << endl;
  return 0;
}
