#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip> 
#include <map>
#include <string>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <iterator>
#include <queue>
#include <set>


#define f(n) for (long long i = 0; i < n; i++)
#define f0(n) for (int j = 0; j < n; j++)
#define co(n) cout << n << "\n";

using namespace std;

vector<long long> fact(int n, vector<long long> fac)
{
    for (int i = fac.size(); i <= n; i++) fac.push_back((fac[i - 1] * i) % 1000000007);
    return fac;
}

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

    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    f(n)
    {
        pair<int, int> b;
        cin >> b.first >> b.second;
        a[i] = b;
    }

    vector<double> b(n);
    f(n) b[i] = atan2(a[i].second, a[i].first);
    sort(b.begin(), b.end());

    int r = 0;
    vector<long long> fac(1);
    fac[0] = 1;

    for(int i = 0; i < n - 1; i++)
    {
        double ll, uu;
        ll = b[i] + atan2(0, -1);
        uu = b[i + 1] + atan2(0, -1);

        int l = 0;
        auto l0 = lower_bound(b.begin(), b.end(), ll);
        l += (l0 - b.begin());
        auto l1 = lower_bound(b.begin(), b.end(), ll - atan2(0, -1) * 2);
        if(ll < 0) l += (l1 - b.begin());

        int u = 0;
        auto u0 = lower_bound(b.begin(), b.end(), uu);
        u += (u0 - b.begin());
        auto u1 = lower_bound(b.begin(), b.end(), uu - atan2(0, -1) * 2);
        if(uu < 0) u += (u1 - b.begin());

        int h = (u - l) % 1000000007;
        if (fac.size() <= max(h + 1,n - h - i - 2)) fac = fact(max(h + 1,n - h - i - 2), fac);

        int k = ((fac[h + 1] % 1000000007) * (fac[n - h - i - 2] % 1000000007)) % 1000000007;
        r = (r + k) % 1000000007;
    }

    cout << r;
}