#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007LL;
ll mymod(ll a) {
  if (a < 0) {
    a = -a;
    a %= MOD;
    return (MOD - a) % MOD;
  }
  return a % MOD;
}
ll mysho(ll a) {
  if (a % MOD == 0)
    return a / MOD;
  else if (a < 0) {
    a = -a;
    a /= MOD;
    return -a - 1;
  }
  return a / MOD;
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  double c;
  vector<tuple<double, ll, ll>> data;
  for (int i = 0; i < n; i++) {
    tuple<double, ll, ll> t((double)(atan2(b[i], a[i]) / (M_PI / 2)) -
                                (int)((double)(atan2(b[i], a[i]) / (M_PI / 2))),
                            a[i], b[i]);
    data.push_back(t);
  }
  sort(data.begin(), data.end());
  ll count = 0;
  for (int i = 0; i < n; i++) {
    int j = i + 1;
    while (j < n && get<0>(data[i]) == get<0>(data[j])) {
      vector<ll> pai(3), pbi(3), paj(3), pbj(3);
      pai[0] = mymod(get<1>(data[i]));
      pai[1] = mysho(get<1>(data[i]));
      pbi[0] = mymod(get<2>(data[i]));
      pbi[1] = mysho(get<2>(data[i]));
      paj[0] = mymod(get<1>(data[j]));
      paj[1] = mysho(get<1>(data[j]));
      pbj[0] = mymod(get<2>(data[j]));
      pbj[1] = mysho(get<2>(data[j]));
      vector<ll> prod(4);
      for (int k = 0; k < 2; k++) {
        for (int l = 0; l < 2; l++) {
          prod[i + j] += pai[k] * paj[l];
          prod[i + j] += pbi[k] * pbj[l];
        }
      }
      for (int k = 0; k < 3; k++) {
        prod[k + 1] += mysho(prod[k]);
        prod[k] = mymod(prod[k]);
      }
      if (!prod[0] && !prod[1] && !prod[2] && !prod[3]) count++;
    }
  }
  cout << ((n * (n - 1) / 2) % MOD + (MOD - count) % MOD) % MOD << endl;
  return 0;
}
