#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const int mod = 1000000007;
const double pi = acos(-1.0);
const double eps = 1e-6;
struct point {
  double x, y, z;
  point() {}
  point(double x, double y) : x(x), y(y) {
    z = atan2(y, x);
    if (z <= 0) z += pi, x = -x, y = -y;
  }
  bool operator<(const point& b) const { return z < b.z; }
} p[200123], q[200123];
double dot(const point& a, const point& b) { return a.x * b.x + a.y * b.y; }
double cross(const point& a, const point& b) { return a.x * b.y - a.y * b.x; }
LL p2[200123]{1};
int main() {
  for (int i = 1; i <= (200000); ++i) {
    p2[i] = p2[i - 1] * 2;
    if (p2[i] >= mod) p2[i] -= mod;
  }
  int n, a = 0, b = 0;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    double x, y;
    scanf("%lf%lf", &x, &y);
    if (abs(x) < eps && abs(y) < eps) {
      continue;
    }
    auto _ = point(x, y);
    if (_.z > pi / 2)
      p[a++] = _;
    else
      q[b++] = _;
  }
  sort(p, p + a);
  sort(q, q + b);
  int c = 0, d = 0, sum = a + b;
  LL ans = 1;
  while (c < a && d < b) {
    int c1 = c + 1;
    while (c1 < a && abs(cross(p[c], p[c1])) < eps) ++c1;
    while (d < b) {
      double x = q[d].x, y = q[d].y;
      auto _ = point(-y, x);
      if (cross(_, p[c]) > eps)
        ++d;
      else
        break;
    }
    if (abs(dot(q[d], p[c])) > eps) {
      c = c1;
      continue;
    }
    int d1 = d + 1;
    while (d1 < b && abs(cross(q[d], q[d1])) < eps) ++d1;
    int x = c1 - c, y = d1 - d;
    sum -= x + y;
    int temp = p2[x] + p2[y] - 1;
    ans = ans * temp % mod;
    c = c1;
    d = d1;
  }
  ans = ans * p2[sum] % mod;
  --ans;
  ans += n - a - b;
  if (ans < 0) ans += mod;
  if (ans >= mod) ans -= mod;
  cout << ans << endl;
  return 0;
}
