#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll mod = 1000000007;
const double eps = 1E-18;
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 {
    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(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};
struct V {
  double x, y;
  V(double x = 0, double y = 0) : x(x), y(y) {}
  V& operator+=(const V& v) {
    x += v.x;
    y += v.y;
    return *this;
  }
  V operator+(const V& v) const { return V(*this) += v; }
  V& operator-=(const V& v) {
    x -= v.x;
    y -= v.y;
    return *this;
  }
  V operator-(const V& v) const { return V(*this) -= v; }
  V& operator*=(double s) {
    x *= s;
    y *= s;
    return *this;
  }
  V operator*(double s) const { return V(*this) *= s; }
  V& operator/=(double s) {
    x /= s;
    y /= s;
    return *this;
  }
  V operator/(double s) const { return V(*this) /= s; }
  double dot(const V& v) const { return x * v.x + y * v.y; }
  double cross(const V& v) const { return x * v.y - v.x * y; }
  double norm2() const { return x * x + y * y; }
  double norm() const { return sqrt(norm2()); }
  V rotate90() const { return V(y, -x); }
  int ort() const {
    if (abs(x) < eps && abs(y) < eps) return 0;
    if (y > 0)
      return x > 0 ? 1 : 2;
    else
      return x > 0 ? 4 : 3;
  }
  bool operator<(const V& v) const {
    int o = ort(), vo = v.ort();
    if (o != vo) return o < vo;
    return cross(v) > 0;
  }
};
bool eq[200005];
int main() {
  ll n;
  cin >> n;
  ll special = 0;
  vector<P> v(n);
  for (int i = (0); i < (n); ++i) {
    cin >> v[i].first >> v[i].second;
    if (v[i].second < 0) {
      v[i].first *= -1;
      v[i].second *= -1;
    }
    if (v[i].second == 0 && v[i].first < 0) {
      v[i].first *= -1;
      v[i].second *= -1;
    }
    if (v[i].first == 0 && v[i].second == 0) {
      special++;
      v.pop_back();
      n--;
    }
  }
  auto comp = [](P a, P b) {
    V va(a.first, a.second);
    V vb(b.first, b.second);
    return va < vb;
  };
  sort(v.begin(), v.end(), comp);
  ll l = 0;
  ll r = 0;
  for (int i = (0); i < (n); ++i) {
    if (v[i].first <= 0) {
      r = i;
      break;
    }
  }
  ll r0 = r;
  for (int i = (0); i < (n - 1); ++i) {
    P p1 = v[i];
    P p2 = v[i + 1];
    ll x1 = p1.first;
    ll y1 = p1.second;
    ll x2 = p2.first;
    ll y2 = p2.second;
    ll dot = -x1 * y2 + y1 * x2;
    if (dot == 0) eq[i] = true;
  }
  vector<P> all;
  while (l < r0 || r < n) {
    if (l == r0) {
      r++;
      all.emplace_back(0, 1);
      continue;
    }
    if (r == n) {
      l++;
      all.emplace_back(1, 0);
      continue;
    }
    P p1 = v[l];
    P p2 = v[r];
    ll x1 = p1.first;
    ll y1 = p1.second;
    ll x2 = p2.first;
    ll y2 = p2.second;
    ll dot = x1 * x2 + y1 * y2;
    if (dot > 0) {
      r++;
      all.emplace_back(0, 1);
      continue;
    }
    if (dot < 0) {
      l++;
      all.emplace_back(1, 0);
      continue;
    }
    P res = P(1, 1);
    if ((!eq[l]) && (!eq[r])) {
      l++;
      r++;
      all.push_back(res);
      continue;
    }
    while (l < r0 && eq[l]) {
      l++;
      res.first++;
    }
    while (r < n && eq[r]) {
      r++;
      res.second++;
    }
    l++;
    r++;
    all.push_back(res);
  }
  mint ans(1);
  for (auto p : all) {
    ll num1 = p.first;
    ll num2 = p.second;
    mint add = mint(1);
    add += (mint(2).pow(num1) - 1);
    add += (mint(2).pow(num2) - 1);
    ans *= add;
  }
  if (special > 0) {
    ans += (mint(2).pow(n));
  }
  ans -= mint(1);
  cout << ans.x << endl;
  return 0;
}
