#include <bits/stdc++.h>
using namespace std;
long power_mod(long base, long exponent, long mod) {
  long result = 1;
  for (int i = 0; i < exponent; i++) {
    result = (base * result) % mod;
  }
  return result;
}
int main() {
  long N;
  long long A[200], B[200], num_orthogonal[200], num_parallel[200];
  cin >> N;
  long num_groups = 0;
  long long A_dummy, B_dummy;
  bool add_new_group;
  for (int i = 0; i < N; i++) {
    cin >> A_dummy >> B_dummy;
    add_new_group = true;
    for (int j = 0; j < num_groups; j++) {
      if (A_dummy * A[j] + B_dummy * B[j] == 0) {
        num_orthogonal[j]++;
        add_new_group = false;
      }
      if (A_dummy * B[j] - B_dummy * A[j] == 0) {
        num_parallel[j]++;
        add_new_group = false;
      }
    }
    if (add_new_group) {
      A[num_groups] = A_dummy;
      B[num_groups] = B_dummy;
      num_orthogonal[num_groups] = 0;
      num_parallel[num_groups] = 1;
      num_groups++;
    }
  }
  unsigned long long num_sets = 1;
  for (int i = 0; i < num_groups; i++) {
    num_sets =
        ((long long)(num_sets *
                     (power_mod(2, num_parallel[i], 1000000007) +
                      power_mod(2, num_orthogonal[i], 1000000007) - 1))) %
        1000000007;
  }
  num_sets--;
  cout << num_sets << endl;
  return 0;
}
