#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
template <class tContainer>
int sum(tContainer const& iContainer) {
  return std::accumulate(std::begin(iContainer), std::end(iContainer), 0);
}
int main() {
  int n;
  cin >> n;
  long long a[n], b[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
  }
  vector<vector<int>> able_map(n, vector<int>(n, 0));
  long long ret = 0;
  for (int i = 0; i < n; ++i) {
    able_map[i][i] = 1;
    for (int j = i + 1; j < n; ++j) {
      if (a[i] * a[j] + b[i] * b[j] == 0) {
        able_map[i][j] = 0;
        able_map[j][i] = 0;
      } else {
        able_map[i][j] = 1;
        able_map[j][i] = 1;
      }
    }
    auto able_to_combine_num = sum(able_map[i]);
    ret =
        (ret + ((long long)pow(2, able_to_combine_num) - able_to_combine_num)) %
        1000000007;
  }
  cout << ret << endl;
  return 0;
}
