#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define PI acos(-1)
#define LSB(i) ((i) & -(i))
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define sc second
#define th third
#define fo fourth
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
#define MOD 1000000007
#define endl "\n"

#define all(data)       data.begin(),data.end()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()
#define ima_li_te(D,d)  find(all(D),d)
#define MAXN 100007
#define MOD 1000000007
ll x[MAXN],y[MAXN],p2[MAXN];
bool cmp(const pll a, const pll b) {return a.fi*1.00/a.sc>b.fi*1.00/b.sc;}
int main()
{
    //ios::sync_with_stdio(false); cin.tie(0);
    p2[0]=1;
    for(int i=1;i<MAXN;i++)
    {
        p2[i]=2*p2[i-1];
        if(p2[i]>=MOD) p2[i]%=MOD;
    }
    ll n; cin>>n;
    for(int i=1;i<=n;i++) cin>>x[i]>>y[i];
    cout<<endl;
    vector<pll> v1,v2,v3,v4,v10,v20,v30,v40 ;
    for(int i=1;i<=n;i++)
    {
        if(x[i]!=0 && y[i]!=0)
        {
            if(x[i]>0 && y[i]>=0) v1.pb(mp(x[i],y[i]));
            if(x[i]<=0 && y[i]>0) v2.pb(mp(x[i],y[i]));
            if(x[i]<0 && y[i]<=0) v3.pb(mp(x[i],y[i]));
            if(x[i]>=0 && y[i]<0) v4.pb(mp(x[i],y[i]));
        }
    }
    sort(all(v1),cmp); sort(all(v2),cmp); sort(all(v3),cmp); sort(all(v4),cmp);
    for(int i=1;i<=n;i++)
    {
        if(x[i]==0)
        {
            if(y[i]>0) v20.pb(mp(x[i],y[i]));
            else v40.pb(mp(x[i],y[i]));
        }
        else if(y[i]==0)
        {
            if(x[i]>0) v10.pb(mp(x[i],y[i]));
            else v30.pb(mp(x[i],y[i]));
        }
    }
    ll rez=p2[n];
    for(int i=0;i<v1.size();i++)
    {
        pll z=v1[i];
        double k=z.fi*1.00/z.sc;
        ll l=0,r=v3.size()-1,itr=0,cnt=(v1.size()-1-i)+v20.size()+v2.size()+v30.size();
        while(l<r)
        {
            ll mid=(l+r)/2;
            if(v3[mid].fi*1.00/v3[mid].sc>k) l=mid+1;
            else r=mid-1;
        }
        ll mid=(l+r)/2;
        if(mid>=0 && mid<v3.size() && v3[mid].fi*1.00/v3[mid].sc>k) itr=mid;
        else itr=mid-1;
        if(itr!=-1) cnt+=itr+1;
        if(cnt>=0)  rez-=p2[cnt];
        if(rez<0) rez+=MOD;
        //cout<<i<<" "<<z.fi<<" "<<z.sc<<" "<<cnt<<endl;
    }
    for(int i=0;i<v2.size();i++)
    {
        pll z=v2[i];
        double k=z.fi*1.00/z.sc;
        ll l=0,r=v4.size()-1,itr,cnt=(v2.size()-1-i)+v30.size()+v3.size()+v40.size();
        while(l<r)
        {
            ll mid=(l+r)/2;
            if(v4[mid].fi*1.00/v4[mid].sc>k) l=mid+1;
            else r=mid-1;
        }
        ll mid=(l+r)/2;
        if(mid>=0 && mid<v4.size() && v4[mid].fi*1.00/v4[mid].sc>k) itr=mid;
        else itr=mid-1;
        if(itr!=-1) cnt+=itr+1;
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
        //cout<<i<<" "<<z.fi<<" "<<z.sc<<" "<<cnt<<endl;
    }
    for(int i=0;i<v3.size();i++)
    {
        pll z=v3[i];
        double k=z.fi*1.00/z.sc;
        ll l=0,r=v1.size()-1,itr,cnt=(v3.size()-1-i)+v40.size()+v4.size()+v10.size();
        while(l<r)
        {
            ll mid=(l+r)/2;
            if(v1[mid].fi*1.00/v1[mid].sc>k) l=mid+1;
            else r=mid-1;
        }
        ll mid=(l+r)/2;
        if(mid>=0 && mid<v1.size() && v1[mid].fi*1.00/v1[mid].sc>k) itr=mid;
        else itr=mid-1;
        if(itr!=-1) cnt+=itr+1;
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
        //cout<<i<<" "<<z.fi<<" "<<z.sc<<" "<<cnt<<endl;
    }
    for(int i=0;i<v4.size();i++)
    {
        pll z=v4[i];
        double k=z.fi*1.00/z.sc;
        ll l=0,r=v2.size()-1,itr,cnt=(v4.size()-1-i)+v10.size()+v1.size()+v20.size();
        while(l<r)
        {
            ll mid=(l+r)/2;
            cout<<l<<" "<<r<<" "<<mid<<" "<<v2[mid].fi<<" "<<v2[mid].sc<<endl;
            if(v2[mid].fi*1.00/v2[mid].sc>k) l=mid+1;
            else r=mid-1;
        }
        ll mid=(l+r)/2;
        if(mid>=0 && mid<v2.size() && v2[mid].fi*1.00/v2[mid].sc>k) itr=mid;
        else itr=mid-1;
        if(z.fi==8 && z.sc==-3) cout<<itr<<endl;
        if(itr!=-1) cnt+=itr+1;
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
        if(z.fi==8 && z.sc==-3) cout<<i<<" "<<z.fi<<" "<<z.sc<<" "<<cnt<<endl;
    }
    for(int i=0;i<v10.size();i++)
    {
        ll cnt=v10.size()-1+v1.size()+v20.size()+v2.size();
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
    }
    for(int i=0;i<v20.size();i++)
    {
        ll cnt=v20.size()-1+v2.size()+v30.size()+v3.size();
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
    }
    for(int i=0;i<v30.size();i++)
    {
        ll cnt=v30.size()-1+v3.size()+v40.size()+v4.size();
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
    }
    for(int i=0;i<v40.size();i++)
    {
        ll cnt=v40.size()-1+v4.size()+v10.size()+v1.size();
        if(cnt>=0) rez-=p2[cnt];
        if(rez<0) rez+=MOD;
    }
    rez--;
    if(rez<0) rez+=MOD;
    cout<<rez<<endl;
    return 0;
}