#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const int INF = 1e9;
const lint LINF = 1e18;
const lint MOD = 1e9 + 7;
const double EPS = 1e-10;
const int mod = 1000000007;
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(long long 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;
  }
};
template <class T>
T gcd(T a, T b) {
  if (b > a) T tmp = a, a = b, b = tmp;
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) {
  if (a == 0 || b == 0)
    return 0;
  else {
    T g = gcd(a, b);
    return g * (a / g) * (b / g);
  }
}
struct p {
  int x, y;
  p(int a, int b) { x = a, y = b; }
  void reg() {
    int t = gcd(abs(x), abs(y));
    x = x / t;
    y = y / t;
    if (x < 0) {
      x = -x;
      y = -y;
    } else if (x == 0) {
      x = 0;
      y = abs(y);
    }
  }
  bool operator<(const p& b) const {
    if (x == b.x) {
      return y < b.y;
    } else {
      return x < b.x;
    }
    long double cx = x;
    long double cy = y;
    long double bx = b.x;
    long double by = b.y;
    return (cx / cy) == (bx / by);
  }
};
struct combination {
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
  mint operator()(int n) { return fact[n]; }
};
int main() {
  lint N;
  cin >> N;
  vector<lint> A(N), B(N);
  for (int i = (int)(0); i < (int)(N); i++) {
    cin >> A[i] >> B[i];
  }
  combination comb(1000000);
  map<p, int> mp;
  for (int i = 0; i < N; i++) {
    p cur = p(A[i], B[i]);
    cur.reg();
    mp[cur]++;
  }
  mint total = mint(2).pow(N) - mint(1);
  cerr << "total.x"
          ":"
       << total.x << endl;
  ;
  mint bad = 0;
  for (int i = 0; i < N; i++) {
    p cur = p(A[i], B[i]);
    if (A[i] < 0) {
      cur = p(-A[i], -B[i]);
    } else if (A[i] == 0) {
      p(A[i], abs(B[i]));
    }
    lint a = mp[cur];
    bad += mint(2).pow(N - 1 - a);
    cerr << "bad.x"
            ":"
         << bad.x << endl;
    ;
  }
  cout << (total - bad).x << endl;
  return 0;
}
