#include<bits/stdc++.h>
using namespace std;
long long MOD=1e9+7;
long long N,NA,NB,NC,ND,sol,step2[100005],pok,x,y;
struct slog{
   double x,y,k;
}t,T[100005],A[100005],B[100005],C[100005],D[100005];
bool cmp(slog a,slog b){
   return a.k<b.k;
}
int main(){
   scanf("%lld",&N);
   for(int i=1; i<=N; i++){
      scanf("%lld %lld",&x,&y);
      T[i].x=x;
      T[i].y=y;
   }
   NA=NB=NC=ND=0;
   for(int i=1; i<=N; i++){
      t=T[i];
      t.k=t.y/t.x;
      if(t.y<0 and t.x==0)t.k=-t.k;
      if(t.x>=0 and t.y>0)A[++NA]=t;
      if(t.x<0 and t.y>=0)B[++NB]=t;
      if(t.x<=0 and t.y<0)C[++NC]=t;
      if(t.x>0 and t.y<=0)D[++ND]=t;
   }
   sort(A+1,A+1+NA,cmp);
   sort(B+1,B+1+NB,cmp);
   sort(C+1,C+1+NC,cmp);
   sort(D+1,D+1+ND,cmp);
   step2[0]=1;
   for(int i=1; i<=100003; i++){
      step2[i]=step2[i-1]+step2[i-1];
      if(step2[i]>=MOD)step2[i]-=MOD;
   }
   pok=0;
   for(int i=1; i<=NA; i++){
      t=A[i];
      while(C[pok+1].k<t.k and pok+1<=NC)pok++;
      sol+=step2[NA-i+NB+pok];
      if(sol>=MOD)sol-=MOD;
   }
   pok=0;
   for(int i=1; i<=NB; i++){
      t=B[i];
      while(D[pok+1].k<t.k and pok+1<=ND)pok++;
      sol+=step2[NB-i+NC+pok];
      if(sol>=MOD)sol-=MOD;
   }
   pok=0;
   for(int i=1; i<=NC; i++){
      t=C[i];
      while(A[pok+1].k<t.k and pok+1<=NA)pok++;
      sol+=step2[NC-i+ND+pok];
      if(sol>=MOD)sol-=MOD;
   }
   pok=0;
   for(int i=1; i<=ND; i++){
      t=D[i];
      while(B[pok+1].k<t.k and pok+1<=NB)pok++;
      sol+=step2[ND-i+NA+pok];
      if(sol>=MOD)sol-=MOD;
   }
   sol=(step2[N]-1+MOD-sol)%MOD;
   cout<<sol<<endl;
   return 0;
}