#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using Graph = vector< vector<int> >;

int main() {
    int N; cin >> N;
    vector<tuple<long double,ll,ll> > XY;
    for (int i = 0; i < N; i++)
    {
        ll a,b; cin >> a >> b;
        if(b < 0){
            a *= -1;
            b *= -1;
        }
        XY.push_back(make_tuple((double)a/(double)sqrt(a*a+b*b),a,b));
    }
    sort(XY.begin(),XY.end());
    
    
    int cnt = 0;
    while(get<0>(XY[cnt])<0){
        cnt++;
    }
    int x,y;
    x = 0; y = cnt;
    int z = cnt;
    cnt = 1;
    vector<int> ANS;
    while(y < N and x < z){
        ll& nai = get<1>(XY[x]);
        ll& nai2 = get<1>(XY[y]);
        ll& nai3 = get<2>(XY[x]);
        ll& nai4 = get<2>(XY[y]);
        nai = nai*nai2+nai3*nai4;
        if(nai > 0){
            ANS.push_back(cnt);
            cnt = 1;
            x++;
        }
        else if(nai < 0){
            ANS.push_back(cnt);
            cnt = 1;
            y++;
        } 
        else{
            cnt++;
            if(z-x > N-y) x++;
            else y++;
        }
    }
    ANS.push_back(cnt);
    ll ans = 1;
    for (int i = 0; i < N; i++)
    {
        ans *= 2;
        ans %= 1000000007;
    }
    ll ans2 = 1;
    for (int i = 0; i < ANS.size(); i++)
    {
        for (int j = 0; j < ANS[i]; j++)
        {
            ll a += ANS[i];
            a%=1000000007;
        }
        
        ans2 *= a;
        ans2 %= 1000000007;
    }
    cout << ans-ans2 << endl;
}
