#include <bits/stdc++.h>
#include <experimental/iterator>

/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
#define ALL(v) v.begin(), v.end()
template<class T> T rng(const T &a, const T &b){ return a < b ? b - a : a - b; }
template<class T> void chmaxmin(T &a, const T &b, const T &(*f)(const T &, const T &)){ a = f(a, b); }
#define chmax(a, b) chmaxmin(a, b, std::max)
#define chmin(a, b) chmaxmin(a, b, std::min)

/* debug */
auto debug = std::experimental::make_ostream_joiner(std::cout, " ");

/* snippet: inf struct */
struct{ template<class T> constexpr operator T(){ return std::numeric_limits<T>::max(); } constexpr auto operator-(); } inf;
struct{ template<class T> constexpr operator T(){ return std::numeric_limits<T>::lowest(); } constexpr auto operator-(); } negative_inf;
constexpr auto decltype(inf)::operator-(){ return negative_inf; }
constexpr auto decltype(negative_inf)::operator-(){ return inf; }

/* snippet: modint library */
#if __cpp_concepts
template<std::signed_integral T, T MOD>
#else
template<class T, T MOD>
#endif
class Modint{
	T val;
public:
	Modint(T val = 0) : val(val % MOD + (val > 0 ? 0 : MOD)) {}
	operator T(){ return val; }
	Modint &operator+=(const Modint &a){ val += a.val; if(val >= MOD) val -= MOD; return *this; }
	Modint &operator-=(const Modint &a){ val -= a.val; if(val < 0) val += MOD; return *this; }
	Modint &operator*=(const Modint &a){ val = val * a.val % MOD; return *this; }
	void inverse(){T x[2]={MOD,val},a[2]={0,1};int i;for(i=0;x[!i];i^=1){a[i]-=x[i]/x[!i]*a[!i];x[i]=x[i]%x[!i];}if(!i)a[i]+= MOD;val=a[i];}
	Modint &operator/=(Modint a){ a.inverse(); return *this *= a; }
	friend Modint modpow(Modint a, int n){ Modint ret(1); while(n){ if(n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
	friend Modint operator+(Modint a, const Modint &b){ return a += b; }
	friend Modint operator-(Modint a, const Modint &b){ return a -= b; }
	friend Modint operator*(Modint a, const Modint &b){ return a *= b; }
	friend Modint operator/(Modint a, const Modint &b){ return a /= b; }
	friend std::ostream &operator<<(std::ostream &os, const Modint &a){ return os << a.val; }
};

/* push n numbers and get i-th min */
/* to get min and 2nd min, declare K_th_min<T, 2> and use get<0>(), get<1>() */
template<class T, std::size_t K>
class K_th_min{
	friend class K_th_min<T, K + 1>;
	T val;
	K_th_min<T, K - 1> lower;
	void push_(T &x){ lower.push_(x); if(val > x) std::swap(val, x); }
public:
	K_th_min() : val(std::numeric_limits<T>::max()) {}
	void push(T x){ push_(x); }
	template<std::size_t I> T get(){ if constexpr(I == K - 1) return val; else return lower.template get<I>(); }
};
template<class T> class K_th_min<T, 0>{ friend class K_th_min<T, 1>; void push_(T &){} public: K_th_min(){} void push(T){} };

/* snippet: using declarations */
using Int = long long;
using std::cout;
using std::cin;
using std::endl;
using Mint = Modint<long long, 1000000007>;

using pii = std::pair<Int, Int>;

double darg(const pii &x){
	double tmp = std::arg(std::complex<double>(x.first, x.second));
	if(tmp < 0){
		tmp += M_PI;
	}
	return tmp;
}

bool eq(const pii &x, const pii &y){
	return x.second * y.first == y.second * x.first;
}
bool ch(const pii &x, const pii &y){
	return x.first * y.first + x.second * y.second == 0;
}

int main(){
	Int n;
	cin >> n;
	std::vector<std::pair<Int, Int>> v;
	RC(i, n){
		Int a, b;
		cin >> a >> b;
		if(a == 0 && b == 0){
		}else{
			v.push_back(pii(a, b));
		}
	}
	std::sort(ALL(v), [](const pii &l, const pii &r){ return darg(l) < darg(r); });
	auto it = std::lower_bound(ALL(v), pii(0, 1), [](const pii &l, const pii &r){ return darg(l) < darg(r); });
	Int bad = std::distance(v.begin(), it);
	std::vector<bool> done(n);

	Mint ans = 1;

	for(Int i = 0; i < v.size(); ++i){
		if(!done[i]){
			Int count = 0, badcount = 0;
			for(Int j = i + 1; j % v.size() != i && eq(v[i], v[j % v.size()]); ++j){
				done[j] = true;
				++count;
			}
			for(; bad % v.size() != i && darg(v[bad % v.size()]) <= darg(v[i]) + M_PI / 2; ++bad){
				if(ch(v[bad % v.size()], v[i])){
					done[bad % v.size()] = true;
					++badcount;
				}
			}
			Mint tmp = 0;
			tmp += modpow(Mint(2), count + 1);
			tmp += modpow(Mint(2), badcount);
			tmp -= Mint(1);
			ans *= tmp;
		}
	}
	ans -= Mint(1);
	cout << ans << endl;

}
