#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int> > VVI;
typedef priority_queue<int, vector<int>, greater<int> > PQ;
const int MAX = 1e6 + 10, MOD = 1e9 + 7;
long long int A[MAX], B[MAX], n;
long long int dfs(int id, vector<int> idx) {
  if (id == n) return idx.size() > 0;
  long long int ret = dfs(id + 1, idx);
  bool ok = 1;
  for (int i = 0; i < idx.size(); i++) {
    if ((A[idx[i]] * A[id] + B[idx[i]] * B[id]) == 0) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    idx.push_back(id);
    ret += dfs(id + 1, idx) % MOD;
  }
  return ret % MOD;
}
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i] >> B[i];
  cout << dfs(0, {}) % MOD << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
