#include <bits/stdc++.h>

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using namespace std::literals::complex_literals;
using ll = std::int64_t;
using P = std::tuple<int,int>;

template <typename T>
T mod_expt(T a, std::int64_t n, T mod){
    T power {1};
    while(n > 0){
        if(n & 1){power = power * a % mod;}
        a = a * a % mod;
        n >>= 1;
    }
    return power;
}

constexpr ll MOD = 1'000'000'007;
constexpr long double EPS = 1e-8;
constexpr long double PI = std::acos(-1);
std::vector<long double> args;
bool used[200100];

int main(){
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int N;
  std::cin >> N;

  int zero_n = 0;
  
  for(int i=0;i<N;++i){
      ll A, B;
      std::cin >> A >> B;

      if(A == 0 && B == 0){
          zero_n += 1;
          continue;
      }

      if(A < 0){
          A = -A;
          B = -B;
      }

      if(A == 0 && B < 0){
          B = -B;
      }

      std::complex<long double> z = (1.0L * A) + 1.0il * (1.0L * B);
      args.emplace_back(std::arg(z));
  }

  // for(int i=0;i<args.size();++i){
  //     std::cout << args[i] << std::endl;
  // }

  std::sort(args.begin(), args.end());

  ll res = 1;
  int M = args.size();
  
  for(int i=0,j=0,k=0,l=0;i<M;){
      if(used[i]){
          i += 1;
          j = i;
          continue;
      }

      while(j < M && std::abs(args[j] - args[i]) < EPS){
          j += 1;
      }

      while(k < M && args[k] - args[i] < PI / 2 - EPS){
          k += 1;
      }
      
      l = k;

      while(l < M && std::abs(args[l] - (args[i] + PI / 2)) < EPS){
          used[l] = true;
          l += 1;
      }

      // std::cout << i << ", " << j << ", " << k << ", " << l << std::endl;

      ll x = 1;
      x += mod_expt<ll>(2, j - i, MOD) - 1;
      x += mod_expt<ll>(2, l - k, MOD) - 1;
      x %= MOD;

      res = res * x % MOD;

      i = j;
      k = l;
  }

  if(res > 0){
      res -= 1;
  }else{
      res = MOD - 1;
  }

  res = (res + zero_n) % MOD;

  std::cout << res << std::endl;
}
