#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, count = 0;
  cin >> N;
  long long A[N], B[N];
  for (long long i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    for (long long j = 0; j <= i; j++) {
      if (A[i] * A[j] + B[i] * B[j] != 0) count++;
    }
  }
  cout << count % 1000000007 << '\n';
  return 0;
}
