#include <bits/stdc++.h>
using namespace std;
using ll = long long;
long double eps = 1e-17;
const long double pi = atan(1) * 4.0;
const ll mod = 1e9 + 7;
const int INF = 1e9;
ll Pow(ll x, ll n) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return Pow(x * x % mod, n / 2);
  else
    return x * Pow(x, n - 1) % mod;
}
int main() {
  int n;
  cin >> n;
  long double dig[n];
  ll z = 0;
  for (int i = 0; i < (int)n; i++) {
    ll x, y;
    cin >> x >> y;
    if (x == 0 && y == 0)
      z++;
    else {
      long double a = x, b = y;
      dig[i] = atan2(b, a);
    }
  }
  sort(dig, dig + n);
  int p = 0;
  int c = 1;
  int num[n];
  for (int i = 0; i < (int)n; i++) num[i] = INF;
  while (p < n) {
    if (num[p] != INF) {
      p++;
      continue;
    }
    int q = p + 1;
    while (q < n && abs(dig[q] - dig[p]) < eps) {
      q++;
    }
    for (int i = p; i < q; i++) num[i] = c;
    int l, r;
    l = lower_bound(dig, dig + n, dig[p] + pi / 2 - eps) - dig;
    r = lower_bound(dig, dig + n, dig[p] + pi / 2 + eps) - dig;
    for (int i = l; i < r; i++) num[i] = -c;
    l = lower_bound(dig, dig + n, dig[p] + pi - eps) - dig;
    r = lower_bound(dig, dig + n, dig[p] + pi + eps) - dig;
    for (int i = l; i < r; i++) num[i] = c;
    l = lower_bound(dig, dig + n, dig[p] + pi * 1.5 - eps) - dig;
    r = lower_bound(dig, dig + n, dig[p] + pi * 1.5 + eps) - dig;
    for (int i = l; i < r; i++) num[i] = -c;
    p = q;
    c++;
  }
  vector<ll> m(3 * n, 0);
  for (int i = 0; i < (int)n; i++) {
    m[num[i] + n]++;
  }
  ll ans = z;
  ll res = 1;
  for (int i = 0; i < (int)3 * n; i++) {
    int l = 2 * n - i;
    if (l >= n) {
      (res *= (Pow(2, m[i]) + Pow(2, m[l]) - 1)) %= mod;
      m[l] = 0;
    } else {
      (res *= Pow(2, m[i])) %= mod;
    }
  }
  ans += res - 1;
  cout << ans << endl;
  return 0;
}
