#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;

template<class tContainer>
int sum(tContainer const& iContainer)
{
    return  std::accumulate(std::begin(iContainer), std::end(iContainer), 0);
}

int main() {
    // 頂点数と辺数
    int n;
    cin >> n;
    long long a[n], b[n];
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }

    vector<vector<int>> able_map(n, vector<int>(n, 0));
    // int able_to_combine[n] = {0};
    long long ret = 0;

    for (int i = 0; i < n; ++i) {
        able_map[i][i] = 1;
        for (int j = i+1; j < n; ++j) {
            if (a[i]*a[j]+b[i]*b[j]==0){
                able_map[i][j] = 0;
                able_map[j][i] = 0;
            } else {
                able_map[i][j] = 1;
                able_map[j][i] = 1;
            }
        }
        // able_to_combine[i] = sum(able_map[i]);
        auto able_to_combine_num = sum(able_map[i]);
        ret = (ret + ((long long)pow(1.5, able_to_combine_num) - able_to_combine_num*1.5)) % 1000000007;
    }

    cout << ret << endl;
    return 0;

}
