#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using pi = pair<int, int>;
using vpi = vector<pi>;
using pl = pair<ll, ll>;
using vpl = vector<pl>;
template <class T>
bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
template <class T>
bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <class T>
void print(std::vector<T> a) {
  int sz = a.size();
  for (int i = 0; i < a.size(); i++) cout << a[i] << (i < sz - 1 ? ' ' : '\n');
}
void ioboost() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
}
const int mod = 1e9 + 7;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
const double PI = 3.1415926535897932;
map<double, pair<int, int>> M;
double a[200020], b[200020];
mint dp[200020][2];
int main(void) {
  ioboost();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  for (int i = 0; i < n; i++) {
    double angle = atan2(b[i], a[i]);
    if (angle < 0) angle += PI;
    M[angle].first++;
    M[angle].second = 0;
  }
  vector<pair<int, int>> P;
  for (auto i : M) {
    if (i.second.second++ == 0) {
      double narg = i.first + 0.5 * PI;
      P.emplace_back(i.second.first, M[narg].first);
      M[narg].second++;
    }
  }
  int m = P.size();
  mint ans = 1;
  for (int i = 0; i < m; i++) {
    if (P[i].second == 0 || P[i].first == 0) {
      ans *= mint(2).pow(P[i].second + P[i].first);
      continue;
    }
    ans *= mint(2).pow(P[i].second + P[i].first) -
           (mint)(mint(2).pow(P[i].second) - 1) *
               (mint)(mint(2).pow(P[i].first) - 1);
  }
  ans -= 1;
  cout << ans << '\n';
}
