#include <bits/stdc++.h>
using namespace std;
long long n, a[200000], b[200000], num = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] * a[j] + b[i] * b[j] == 0) {
        n = n - 1;
      }
    }
  }
  num = n * (n + 1) / 2;
  cout << num % 1000000007 << endl;
  return 0;
}
