#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i) >> b.at(i);
  }
  int al1, al2, all = 0;
  for (int i = 1; i <= (n - 1) / 2; i++) {
    int i2 = i;
    int n2 = n;
    al1 = 1;
    al2 = 1;
    for (int j = 1; j <= i; j++) {
      al1 *= i2;
      i2--;
      al2 *= n2;
      n2--;
    }
    all += al2 / al1;
  }
  all *= 2;
  if (n % 2 == 0) {
    al1 = 1;
    al2 = 1;
    int i3 = n / 2;
    int n3 = n;
    for (int i = 1; i <= n / 2; i++) {
      al1 *= i3;
      i3--;
      al2 *= n3;
      n3--;
    }
    all += al2 / al1;
  }
  all += 1;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a.at(i) * a.at(j) + b.at(i) * b.at(j) == 0) all--;
    }
  }
  cout << all % 1000000007 << endl;
}
