#include <bits/stdc++.h>
using namespace std;
long long N;
map<pair<long long, long long>, long long> num;
long long pow2[200001];
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a > b)
    return gcd(a - b, b);
  else
    return gcd(a, b - a);
}
pair<long long, long long> simp(pair<long long, long long> x) {
  if (x.second < 0) x.first = -x.first, x.second = -x.second;
  long long a = gcd(abs(x.first), abs(x.second));
  return pair<long long, long long>(x.first / a, x.second / a);
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> N;
  for (long long i = 1; i <= long long(N); ++i) {
    long double a, b;
    cin >> a >> b;
    num[simp(pair<long long, long long>(a, b))]++;
  }
  pow2[0] = 1;
  for (long long i = 1; i <= long long(N); ++i)
    pow2[i] = (pow2[i - 1] * 2) % 1000000007;
  long long ans = 1;
  for (auto i : num) {
    pair<long long, long long> cur = i.first;
    pair<long long, long long> x =
        simp(pair<long long, long long>(-cur.second, cur.first));
    ans *= (pow2[num[i.first]] + pow2[num[x]] - 1) % 1000000007;
    ans %= 1000000007;
    if (num.find(x) != num.end()) num[x] = 0;
    num[i.first] = 0;
  }
  cout << ans - 1;
}
