#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  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 { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= 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(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
const double eps = 1e-5;
int main() {
  ios::sync_with_stdio(false);
  vector<pair<double, int>> p, p2;
  int n;
  cin >> n;
  vector<ll> a(n), b(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i] >> b[i];
    if (b[i] == 0 && a[i] < 0)
      p.push_back({atan2(b[i], -a[i]), i});
    else if (b[i] > 0)
      p.push_back({atan2(b[i], a[i]), i});
    else
      p.push_back({atan2(-b[i], -a[i]), i});
  }
  p2 = p;
  sort(p.begin(), p.end());
  mint ans = 0;
  vector<mint> pow2(n);
  pow2[0] = 1;
  for (int i = 0; i < (n - 1); ++i) pow2[i + 1] = pow2[i] * 2;
  for (int i = 0; i < (n); ++i) {
    double teki;
    if (p2[i].first <= M_PI / 2)
      teki = p2[i].first + M_PI / 2;
    else
      teki = p2[i].first - M_PI / 2;
    int x = 0;
    for (auto j =
             lower_bound(p.begin() + 1 + i, p.end(), make_pair(teki - eps, 0));
         j < upper_bound(p.begin() + 1 + i, p.end(), make_pair(teki + eps, 0));
         j++) {
      int j_idx = (*j).second;
      int i_idx = i;
      if (j == p.end()) continue;
      if (i_idx >= j_idx) continue;
      if (a[i_idx] * a[j_idx] + b[i_idx] * b[j_idx] == 0) x++;
    }
    ans += pow2[n - x - i - 1];
  }
  cout << ans << endl;
}
