#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
void ins() {}
template <class T, class... Rest>
void ins(T& v, Rest&... rest) {
  cin >> v;
  ins(rest...);
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  os << "{";
  for (size_t i = 0; i < vec.size(); ++i) os << (i ? ", " : "") << vec[i];
  os << "}";
  return os;
}
ostream& operator<<(ostream& os, const vector<char>& v) {
  for (size_t i = 0; i < v.size(); ++i) os << v[i];
  return os;
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& rhs) {
  os << "(" << rhs.first << ", " << rhs.second << ")";
  return os;
}
template <int MOD>
struct MInt {
  long long val;
  constexpr MInt(long long val = 0) : val(val % MOD) {
    if (val < 0) val += MOD;
  }
  MInt operator-() const { return MInt(-val); }
  MInt operator+(const MInt& n) const { return MInt(val) += n; }
  MInt operator-(const MInt& n) const { return MInt(val) -= n; }
  MInt operator*(const MInt& n) const { return MInt(val) *= n; }
  MInt operator/(const MInt& n) const { return MInt(val) /= n; }
  MInt& operator+=(const MInt& n) {
    val = (val + n.val) % MOD;
    return *this;
  }
  MInt& operator-=(const MInt& n) {
    val = (MOD + val - n.val) % MOD;
    return *this;
  }
  MInt& operator*=(const MInt& n) {
    val = (val * n.val) % MOD;
    return *this;
  }
  MInt& operator/=(const MInt& n) {
    val = (*this * n.inv()).val;
    return *this;
  }
  bool operator==(const MInt& n) { return val == n.val; }
  bool operator!=(const MInt& n) { return val != n.val; }
  MInt pow(long long n) const {
    MInt pow = val, ans = 1;
    for (long long p = n; p > 0; p >>= 1, pow *= pow)
      if (p & 1) ans *= pow;
    return ans;
  }
  MInt inv() const { return pow(MOD - 2); }
  friend ostream& operator<<(ostream& os, const MInt& n) {
    os << n.val;
    return os;
  }
  friend istream& operator>>(istream& os, MInt& n) {
    os >> n.val;
    return os;
  }
};
constexpr int MOD = 1e9 + 7;
constexpr double eps = 1e-10;
using mint = MInt<MOD>;
int main() {
  int N;
  cin >> N;
  ;
  vector<double> v;
  int zeros = 0;
  vector<ll> A(N), B(N);
  for (int i = 0, _i = (N); i < _i; ++i) {
    cin >> A[i] >> B[i];
    if (A[i] == 0 && B[i] == 0)
      ++zeros;
    else {
      double theta = atan2(B[i], A[i]);
      if (theta < 0) theta += M_PI;
      if (abs(theta - M_PI) < 1e-8) theta = 0;
      v.push_back(theta);
    }
  }
  (([&](decltype((v)) cccc) { return (sort)(begin(cccc), end(cccc)); })(v));
  int count = 0;
  mint X = 1;
  for (int i = 0, _i = (v.size()); i < _i; ++i) {
    int countV = upper_bound(v.begin(), v.end(), v[i] + eps) -
                 lower_bound(v.begin(), v.end(), v[i] - eps);
    int tmp = 0;
    tmp += upper_bound(v.begin() + i + 1, v.end(), v[i] + M_PI / 2.0 + eps) -
           lower_bound(v.begin() + i + 1, v.end(), v[i] + M_PI / 2.0 - eps);
    if (tmp > 0) {
      count += countV + tmp;
      X *= (mint(2).pow(countV)) + (mint(2).pow(tmp)) - 2 + 1;
    }
    i += countV - 1;
  }
  42;
  42;
  mint ans = mint(2).pow(N - zeros - count) * X - 1;
  cout << ans << endl;
  return 0;
}
