#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using ULL = int64_t;
using P = pair<LL, LL>;
vector<LL> s;
vector<LL> a;
vector<LL> b;
LL dfs(const LL &n, const LL depth) {
  if (depth == n) {
    return 1LL;
  }
  LL sum = 0;
  sum += dfs(n, depth + 1);
  bool new_fish = true;
  for (const auto &existed : s) {
    const auto val = a[existed] * a[depth] + b[existed] * b[depth];
    if (val == 0) {
      new_fish = false;
      break;
    }
  }
  if (new_fish) {
    s.push_back(depth);
    sum += dfs(n, depth + 1);
    s.pop_back();
  }
  return sum % 1000000007LL;
}
int main() {
  LL n;
  cin >> n;
  for (LL i = 0; i < (n); ++i) {
    LL aa, bb;
    cin >> aa >> bb;
    a.push_back(aa);
    b.push_back(bb);
  }
  auto sum = dfs(n, 0);
  cout << sum - 1 << endl;
}
