#include <bits/stdc++.h>

using namespace std; 

int P = 1000000000 + 7; 

int main () {
    
    ios_base::sync_with_stdio(false); 
    cin.tie(0); 
    cout.tie(0); 
    
    int n;  
    
    cin>>n; 
    
    if(n < 4) {
        
        double k[n];
    int s[n];
    
    for(int i = 0 ; i < n ; i++) {
        
        int x, y; 
        
        cin>>x>>y; 
        
        k[i] = abs(y/(double)x);  
        
        if(x == 0) { s[i] = -1; continue; }
        if(y == 0) { s[i] = -2; continue; }
        if(x > 0 && y > 0) { s[i] = 1;  continue; }
        if(x > 0) { s[i] = 4;  continue; }
        if(y > 0) { s[i] = 2; continue; } 
        s[i] = 3;

    }
    
    int br = 0; 
    
    for(int i = 0 ; i < n ; i++) {
        
        for(int j = i+1 ; j < n ; j++) {
            
            if(k[i] == k[j]) {
                
                if (s[i] < 0 && s[i] == s[j]) { br++; continue; }
                if (abs(s[i]-s[j]) == 2) { br++; continue; }
                
            }
            
        }
        
    }
    
    if(br == 0) { cout<<0; return 0; }
    cout<<2;
    return 0;
        
    }
    
    double k[n];
    int s[n];
    int g = 0;
    int d = 0; 
    
    for(int i = 0 ; i < n ; i++) {
        
        int x, y; 
        
        cin>>x>>y; 
        
        if(y > 0) { g++; }
        if(y < 0) { d++; } 
        
        k[i] = abs(y/(double)x);  
        
        if(x == 0) { s[i] = -1; continue; }
        if(y == 0) { s[i] = -2; continue; }
        if(x > 0 && y > 0) { s[i] = 1;  continue; }
        if(x > 0) { s[i] = 4;  continue; }
        if(y > 0) { s[i] = 2; continue; } 
        s[i] = 3;

    }
    
    int br = 0; 
    
    for(int i = 0 ; i < n ; i++) {
        
        for(int j = i+1 ; j < n ; j++) {
            
            if(k[i] == k[j]) {
                
                if (s[i] < 0 && s[i] == s[j]) { br++; continue; }
                if (abs(s[i]-s[j]) == 2) { br++; continue; }
                
            }
            
        }
        
    }
    
    if(g > d) { cout<<(g*br)%P; return 0; }
    cout<<(d*br)%P; 
    
    return 0; 
    
}