#include<bits/stdc++.h>
using namespace std;

double f(double x){
    if(x<-3.0) return 0.0;
    else if(x>3.0) return 3.0;
    else return (x+3.0)/2.0;
}
double angleOf(int x,int y){
    return f(y/(double)x);
}
bool contains(double a,double b,double c){
    a+=3.0;
    if(a>=6.0) a-=6.0;
    b+=3.0;
    if(b>=6.0) b-=6.0;
    if(a>b) swap(a,b);
    return a<=c&&c<=b;
}

struct point{
    double angle;
    bool real;
};

struct point* points;
int n,i,x,y,res,unreal,l,mul;
unsigned long long triN,previ;

bool compare(const struct point& a,const struct point& b){
    return a.angle<b.angle;
}

int main(){
    cin>>n;
    i=n;
    points=new struct point[2*n];
    while(i--){
        cin>>x>>y;
        points[2*i].angle=angleOf(x,y);
        points[2*i].real=true;
        points[2*i+1].angle=points[2*i].angle+3.0;
        if(points[2*i+1].angle>=6.0) points[2*i+1].angle-=6.0;
        points[2*i+1].angle=false;
    }
    l=n*2;
    sort(points,points+l,&compare);

    for(i=0;i<l;i++){
        if(points[i].real){
            triN+=unreal*(unreal-1);
        }else unreal++;
    }
    res=triN%1000000007ull;
    previ=res;
    for(i=0;i<n;i++){
        previ*=n-3-i;
        res+=(previ/(3+i))%1000000007ull;
    }

    cout<<res<<endl;

    return 0;
}