#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(2));
  vector<int> st(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i).at(0);
    cin >> a.at(i).at(1);
    st.at(i) = a.at(i).at(0) * a.at(i).at(1);
  }
  int sum = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j <= n - 1; i++) {
      if (st.at(i) + st.at(j) != 0) {
        sum++;
      }
    }
  }
  cout << sum % 1000000007 << endl;
}
