#include <vector>
#include <cstdint>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <utility>

using std::vector;
using std::cout;
using std::cin;
using std::endl;

using ll = long long;
using ull = unsigned long long;

ll get_gcd(ll a, ll b){
    return a;
}

inline ull p2(ull power){
    return (1<<power);
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    ll n,a,b;
    std::cin >> n;
    std::unordered_map<double, std::pair<ull,ull>> slope;
    std::unordered_map<double, ull> slope_r;

    for(ull i=0; i<n; i++){
        cin >> a >> b;
        // ll gcd = get_gcd(abs(a),abs(b));
        // a /= gcd;
        // b /= gcd;
        if(slope.find(1.0*a/b)!=slope.end()){
            // if the same slope is found
            slope[1.0*a/b].first++; 
        }else if(slope.find(-1.0*b/a)!=slope.end()){
            // if the orthogonal slope is found
            slope[-1.0*b/a].second++; 
        }else{
            slope[1.0*a/b].first  = 1;
            slope[1.0*a/b].second = 0;
        }
    }
    ull ans = 1;
    for(const auto& e: slope){
        ull factor;
        factor = (p2(e.second.first)+p2(e.second.second)-1)%1000000007;
        ans *= factor;
        ans %= 1000000007;
    }
    ans--;
    cout << ans << endl;
    
    return 0;
}