#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];
  }
  long long int count = 0;
  for (int bit = 0; bit < (1 << N); bit++) {
    vector<int> fish;
    bool ok = true;
    for (int i = 0; i < N; i++) {
      if (bit & (1 << i)) {
        fish.push_back(i);
      }
    }
    int f = fish.size();
    for (int bit_2 = 0; bit_2 < (1 << f); bit_2++) {
      vector<int> fish_2;
      for (int j = 0; j < f; j++) {
        if (bit_2 & (1 << j)) {
          fish_2.push_back(j);
        }
      }
      if (fish_2.size() == 2) {
        int fish1 = fish[fish_2[0]];
        int fish2 = fish[fish_2[1]];
        if (A[fish1] * A[fish2] + B[fish1] * B[fish2] == 0) {
          ok = false;
        }
      }
    }
    if (ok) {
      count += 1;
    }
  }
  int output;
  output = (count - 1) % 1000000007;
  cout << output << endl;
  return 0;
}
