#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

constexpr double EPS = 1e-9;
// 誤差を考慮した符号
inline int sgn(const double x) {
	return (x > EPS) - (x < -EPS);
}
inline int sgn(const double l, const double r) {
	return sgn(l - r);
}

using fint64 = int_fast64_t;
template<fint64 MOD>
struct ModInt {
	fint64 x;
	ModInt():x(0){}
	ModInt(fint64 x):
		x(x>=0?x%MOD:(MOD-(-x)%MOD)%MOD)
		{}
	// 負号
	ModInt operator -() const{
		return ModInt(-x);
	}
	// 加算
	ModInt &operator +=(const ModInt &rhs){
		x+=rhs.x;
		if(x>=MOD) x-=MOD;
		return (*this);
	}
	ModInt operator +(const ModInt &rhs) const{
		return ModInt(*this)+=rhs;
	}
	// 減算
	ModInt &operator -=(const ModInt &rhs){
		x+=MOD-rhs.x;
		if(x>=MOD) x-=MOD;
		return (*this);
	}
	ModInt operator -(const ModInt &rhs) const{
		return ModInt(*this)-=rhs;
	}
	// 乗算
	ModInt &operator *=(const ModInt &rhs){
		x*=rhs.x;
		if(x>=MOD) x%=MOD;
		return (*this);
	}
	ModInt operator *(const ModInt &rhs) const{
		return ModInt(*this)*=rhs;
	}
	// 除算
	ModInt &operator /=(const ModInt &rhs){
		(*this)*=rhs.inverse();
		return (*this);
	}
	ModInt operator /(const ModInt &rhs) const{
		return ModInt(*this)/=rhs;
	}
	// 等号
	bool operator ==(const ModInt &rhs){
		return x==rhs.x;
	}
	bool operator !=(const ModInt &rhs){
		return x!=rhs.x;
	}
	// 累乗
	ModInt pow(fint64 n) const{
		fint64 tmp=x;
		fint64 ret=1;
		while(n>0){
			if(n&1) ret=ret*tmp%MOD;
			tmp=tmp*tmp%MOD;
			n>>=1ll;
		}
		return ModInt(ret);
	}
	// 逆元
	ModInt inverse() const{
		fint64 a=x,b=MOD,s=1,t=0;
		while(b>0){
			fint64 u=a/b;
			a-=u*b;
			s-=u*t;
			swap(a,b);
			swap(s,t);
		}
		return ModInt(s);
	}
	// 入出力
	friend istream &operator >>(istream &lhs,ModInt<MOD> &rhs){
		fint64 x; lhs>>x;
		rhs=ModInt<MOD>(x);
		return lhs;
	}
	friend ostream &operator <<(ostream &lhs,const ModInt<MOD> &rhs){
		return lhs<<rhs.x;
	}
};

using mint = ModInt<MOD>;
int main() {
	const double pi = acos(-1);
	int n; cin >> n;
	/*
		double a[n], b[n];
		for(int i = 0; i < n; ++i) {
			cin >> a[i] >> b[i];
		}
		for(int i = 0; i < n; ++i) {
			for(int)
			cin >> a[i] >> b[i];
		}
	*/ 
	mint zero = 0;
	vector<double> v;
	for(int i = 0; i < n; ++i) {
		int64_t a, b; cin >> a >> b;
		if(a == 0) {
			if(b == 0) {
				zero += 1;
				continue;
			}
			v.push_back(-pi / 2);
		} else {
			double arg = atan((double)b / (double)a);
			// cerr << arg << '\n';
			v.push_back(arg);
		}
	}
	v.push_back(INF);
	sort(v.begin(), v.end());
	// for(double i : v) {
	// 	cout << i << '\n';
	// }
	vector<double> arg;
	vector<int> cnt;
	int tmp = 1;
	for(int i = 1; i < v.size(); ++i) {
		if(sgn(v[i - 1], v[i]) == 0) {
			tmp++;
		} else {
			cnt.emplace_back(tmp);
			arg.emplace_back(v[i - 1]);
			tmp = 1;
		}
	}
	mint ans = 1;
	int cn = cnt.size();
	bool used[cn] = {};
	for(int i = 0; i < cn; ++i) {
		// cerr << arg[i] << '\n';
		if(used[i]) continue;
		int idx = lower_bound(arg.begin(), arg.end(), arg[i] + pi / 2 - EPS) - arg.begin();
		mint po = 2;
		if(sgn(arg[i], arg[idx] - pi / 2) == 0) {
			used[idx] = true;
			ans *= po.pow(cnt[i]) + po.pow(cnt[idx]) - 1;
		} else {
			ans *= po.pow(cnt[i]);
		}
		// cerr << ans << '\n';
	}
	cout << ans - 1 + zero << '\n';
	return 0;
}