#include <bits/stdc++.h>
using namespace std;
const long long devideByNum = 1000000007;
long long calc(long long num) {
  long long ans = num % devideByNum;
  for (int singleNum = num - 1; singleNum >= 1; --singleNum) {
    ans *= singleNum % devideByNum;
    ans %= devideByNum;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<pair<long long, long long>> tasteAndSmellVec;
  vector<int> NGnumVec(n);
  for (int i = 0; i < n; ++i) {
    long long a, b;
    cin >> a >> b;
    for (const auto &singlePair : tasteAndSmellVec) {
      if (a * singlePair.first + b * singlePair.second == 0) {
        ++NGnumVec.at(i);
      }
    }
    tasteAndSmellVec.push_back(make_pair(a, b));
  }
  long long combiCount = 0;
  for (int i = n - 1; i >= 0; --i) {
    combiCount += calc(i - NGnumVec.at(i));
    combiCount %= devideByNum;
  }
  cout << combiCount << endl;
}
