#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[i];
    cin >> B[i];
  }
  int all = 1 << n;
  int count = 0;
  bool fish = false;
  for (int mask = 0; mask < all; mask++) {
    for (int i = 0; i < n - 1; i++) {
      if ((mask >> i) & 1) {
        for (int j = i + 1; j < n; j++) {
          if (((mask >> j) & 1) && A[i] * A[j] + B[i] * B[j] == 0) fish = false;
          if (!fish) break;
        }
      }
      if (!fish) break;
    }
    if (fish) {
      count++;
      count %= 1000000007;
    }
    fish = true;
  }
  cout << count << endl;
}
