#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ld = long double;
using vld = vector<ld>;
const int MOD = 1000000007;
const int MOD_MAX = 200000;
const ld eps = 0.0000000000000001;
ll fact_arr[MOD_MAX], finv_arr[MOD_MAX], inv_arr[MOD_MAX];
void comb_init() {
  fact_arr[0] = fact_arr[1] = 1;
  finv_arr[0] = finv_arr[1] = 1;
  inv_arr[1] = 1;
  for (int i = 2; i < MOD_MAX; i++) {
    fact_arr[i] = fact_arr[i - 1] * i % MOD;
    inv_arr[i] = MOD - inv_arr[MOD % i] * (MOD / i) % MOD;
    finv_arr[i] = finv_arr[i - 1] * inv_arr[i] % MOD;
  }
}
class mint {
 public:
  ll value;
  mint(ll a = 0) : value((a % MOD + MOD) % MOD) {}
  bool operator<(mint a) { return this->value < a.value; }
  bool operator>(mint a) { return this->value > a.value; }
  bool operator<=(mint a) { return this->value <= a.value; }
  bool operator>=(mint a) { return this->value >= a.value; }
  mint& operator+=(const mint& a) {
    if ((this->value += a.value) > MOD) this->value -= MOD;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((this->value -= a.value) < 0ll) this->value += MOD;
    return *this;
  }
  mint& operator*=(const mint& a) {
    (this->value *= a.value) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint ret(this->value);
    return ret += a;
  }
  mint operator-(const mint a) const {
    mint ret(this->value);
    return ret -= a;
  }
  mint operator*(const mint a) const {
    mint ret(this->value);
    return ret *= a;
  }
  mint pow(ll times) const {
    if (!times) return 1;
    mint ret = pow(times >> 1);
    ret *= ret;
    if (times & 1) ret *= *this;
    return ret;
  }
  mint inv() const { return pow(MOD - 2); }
  mint& operator/=(const mint& a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint ret(this->value);
    return ret /= a;
  }
  friend ostream& operator<<(ostream& os, const mint& m) {
    os << m.value;
    return os;
  }
};
mint comb(mint n, mint r) {
  if (n < r || n < 0 || r < 0) return 0;
  return mint(fact_arr[n.value]) * mint(finv_arr[r.value]) *
         mint(finv_arr[(n - r).value]);
}
mint hcomb(mint n, mint r) { return comb(n + r - 1, r); }
mint comb_slow(mint n, mint r) {
  if (n < r || n.value < 0 || r.value < 0) return mint(0ll);
  mint ret = 1ll;
  if (r > n / 2) r = n - r;
  for (int i = 0; i < r.value; i++) ret = ret * (n - i);
  for (int i = 0; i < r.value; i++) ret = ret / (i + 1);
  return ret;
}
mint hcomb_slow(mint n, mint r) { return comb_slow(n + r - 1, r); }
bool equal(ld a, ld b) {
  if (0.9 < a / b && a / b < 1.1) {
    if (abs(a - b) < eps) {
      return true;
    }
    return false;
  } else
    return false;
}
int main() {
  int n;
  cin >> n;
  vll as(n, 0), bs(n, 0);
  vld a_b(n, 0), b_a(n, 0);
  for (int i = 0; i < (int)n; i++) {
    cin >> as[i] >> bs[i];
    a_b[i] = ld(as[i]) / bs[i];
    b_a[i] = ld(bs[i]) / as[i];
  }
  sort(a_b.begin(), a_b.end());
  sort(b_a.begin(), b_a.end());
  int i = 0, j = 0;
  mint sum = 0;
  while (i < n && j < n) {
    if (equal(a_b[i], b_a[j])) {
      if (as[i] * as[j] + bs[i] * bs[j] == 0) sum += 1;
      if (a_b[i] < b_a[j]) {
        i++;
      } else {
        j++;
      }
    } else {
      if (a_b[i] < b_a[j]) {
        i++;
      } else {
        j++;
      }
    }
  }
  cout << sum.value << endl;
}
