#include <bits/stdc++.h>
#include <iostream>
#include <boost/multiprecision/cpp_dec_float.hpp>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}


// aのp乗を求める関数
ll mpow(ll a, ll b){
	if(b==0){
		return 1;
	}else if(b%2==0){
		ll memo = mpow(a,b/2);
		return memo*memo%MOD;
	}else{
		return mpow(a,b-1)*a%MOD;
	}
}

namespace mp = boost::multiprecision;
// 仮数部 500 bit の浮動小数点数
using cpp_dec_float = mp::number<mp::cpp_dec_float<1000>>;

cpp_dec_float retarctan(cpp_dec_float a, cpp_dec_float b){
	// if(a==0) return 0;
	if(a==0&&b==0) return -100.0;
	if(b<0) a*=-1, b*=-1;
	// cerr<<"atan" SP a SP b<<endl;
	cpp_dec_float ret = atan2(b,a);
	// if(ret<0) ret+=PI/2;
	return ret;
}



signed main(){
	int n; cin>>n;
	map<cpp_dec_float,PLL> m;
	ll zero=0LL;
	rep(i,n){
		cpp_dec_float a,b; cin>>a>>b;
		cpp_dec_float arg=retarctan(a,b);
		if(arg==-100.0){
			zero++; continue;
		}
		// if(arg<0) arg+=PI;
		if(arg<PI/2) m[arg].first++;
		else{
			arg=arg-PI/2;
			m[arg].second++;
		}
		cerr<<a SP b SP arg<<endl;
	}


	ll ans=1LL;
	for(auto itr=m.begin(); itr!=m.end(); ++itr){
		// double arg=itr->first;
		ll cnt1=itr->second.first;
		ll cnt2=itr->second.second;
		// cout<<arg SP cnt1 SP cnt2<<endl;
		ll tmp=0LL;
		tmp+=mpow(2,cnt1); tmp+=mpow(2,cnt2); tmp%=MOD;
		// cerr<<ans SP tmp-1<<endl;
		ans*=tmp-1; ans%=MOD;
	}

	cout<<ans-1+zero<<endl;

	return 0;
}
