#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define PI acos(-1)
#define LSB(i) ((i) & -(i))
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define sc second
#define th third
#define fo fourth
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
#define MOD 1000000007
#define endl "\n"

#define all(data)       data.begin(),data.end()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()
#define ima_li_te(D,d)  find(all(D),d)
#define MAXN 100007
#define MOD 1000000007
ll x[MAXN],y[MAXN],p2[MAXN];
float area(int x1, int y1, int x2, int y2, int x3, int y3)
{
   return abs((x1*(y2-y3) + x2*(y3-y1)+ x3*(y1-y2))/2.0);
}
bool suprotan(int x1,int y1,int x2,int y2)
{
    if(x1*x2<=0 && y1*y2<=0) return true;
    else return false;
}
bool unutra(int x1, int y1, int x2, int y2, int x3, int y3, int x, int y)
{
   float a=area(x1, y1, x2, y2, x3, y3);
   float a1=area(x, y, x2, y2, x3, y3);
   float a2=area(x1, y1, x, y, x3, y3);
   float a3=area(x1, y1, x2, y2, x, y);
   if(a==a1+a2+a3 && a>0) return true;
   else if(a==a1+a2+a3)
   {
       if(suprotan(x1,y1,x2,y2) || suprotan(x1,y1,x3,y3) || suprotan(x2,y2,x3,y3)) return true;
   }
   else return false;
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    p2[0]=1;
    for(int i=1;i<MAXN;i++)
    {
        p2[i]=2*p2[i-1];
        if(p2[i]>=MOD) p2[i]%=MOD;
    }
    ll n; cin>>n;
    for(int i=1;i<=n;i++) cin>>x[i]>>y[i];
    if(n==3)
    {
        ll cnt=0;
        if(unutra(x[1],y[1],x[2],y[2],x[3],y[3],0,0)) cnt++;
        if(area(x[1],y[1],x[2],y[2],0,0)==0 && suprotan(x[1],y[1],x[2],y[2])) cnt++;
        if(area(x[1],y[1],x[3],y[3],0,0)==0 && suprotan(x[1],y[1],x[3],y[3])) cnt++;
        if(area(x[2],y[2],x[3],y[3],0,0)==0 && suprotan(x[3],y[3],x[2],y[2])) cnt++;
        cout<<cnt<<endl;
    }
    else
    {
        bool check=true;
        if(y[1]!=1) check=false;
        for(int i=2;i<=n;i++)
        {
            if(y[i]!=-1) check=false;
        }
        if(check)
        {
            ll rez=0,cntl=0,cntr=0;
            for(int i=2;i<=n;i++)
            {
                if(x[i]<=-x[1]) cntl++;
            }
            for(int i=2;i<=n;i++)
            {
                if(x[i]>=-x[1]) cntr++;
            }
            if(cntl+cntr==n-1)
            {
                for(int i=1;i<=min(cntl,cntr);i++)
                {
                    rez+=i*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
                for(int i=min(cntl,cntr)+1;i<=max(cntl,cntr);i++)
                {
                    rez+=min(cntl,cntr)*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
                for(int i=max(cntl,cntr)+1;i<=max(cntl,cntr)+min(cntl,cntr)-1;i++)
                {
                    rez+=(max(cntl,cntr)+min(cntl,cntr)-1-i+1)*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
            }
            else
            {
                rez+=1;
                for(int i=1;i<min(cntl,cntr);i++)
                {
                    rez+=(i+1)*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
                for(int i=min(cntl,cntr);i<=max(cntl,cntr)-1;i++)
                {
                    rez+=min(cntl,cntr)*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
                for(int i=max(cntl,cntr);i<=max(cntl,cntr)+min(cntl,cntr)-2;i++)
                {
                    rez+=(max(cntl,cntr)+min(cntl,cntr)-2-i+1)*p2[i-1];
                    if(rez>=MOD) rez%=MOD;
                }
            }
            cout<<rez<<endl;
        }
    }
    return 0;
}