// deo koda uzet sa https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/

#include <bits/stdc++.h>
using namespace std;
long long x[100010], y[100010];
long long n;
const long long MOD = 1e9 + 7;
long long brtacaka = 0;
double area(long long x1, long long y1, long long x2, long long y2, long long x3, long long y3){
   return abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2))/2.0);
}
bool isInside(long long x1, long long y1, long long x2, long long y2, long long x3, long long y3, long long x, long long y){  
   double A = area (x1, y1, x2, y2, x3, y3);
   double A1 = area (x, y, x2, y2, x3, y3);
   double A2 = area (x1, y1, x, y, x3, y3);
   double A3 = area (x1, y1, x2, y2, x, y);
   return (abs(A - (A1 + A2 + A3)) < 0.000000001);
}
long long power(long long x, long long y, long long p)
{
    long long res = 1;     // Initialize result
 
    x = x % p; // Update x if it is more than or
                // equal to p
  
    if (x == 0) return 0; // In case x is divisible by p;
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;
 
        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}
int main(){
	scanf("%lld", &n);
	long long brkeceva = 0;
	long long brminuskeceva = 0;
	for(int i = 1; i <= n; i++){
		scanf("%lld %lld", &x[i], &y[i]);
		if(y[i] == 1)
			brkeceva++;
		if(y[i] == -1)
			brminuskeceva++;
	}
	if(brkeceva == 1 && brminuskeceva == n - 1 && y[1] == 1){
		long long brVecihOdMinusX = 0;
		long long brManjihOdMinusX = 0;
		for(int i = 1; i <= n; i++){
			if(y[i] == -1){
				if(x[i] > -x[1])
					brVecihOdMinusX++;
				if(x[i] < -x[1])
					brManjihOdMinusX++;
			}
		}
		printf("%lld\n", ((power(2, n, MOD) - 1 - (power(2, brManjihOdMinusX, MOD) - 1) - (power(2, brVecihOdMinusX, MOD) - 1) - (power(2, n - 1, MOD) - 1) - 1) % MOD + MOD) % MOD);
	}
    if(n == 3 && !(brkeceva == 1 && brminuskeceva == n - 1 && y[1] == 1)){
		long long rez = 0;
		// ako su sve tri kolinearne
		if(abs(area(0, 0, x[1], y[1], x[2], y[2])) < 0.000000001 && abs(area(x[3], y[3], x[1], y[1], x[2], y[2])) < 0.000000001){
			if((x[1] > 0 && x[2] > 0 && x[3] > 0) || (x[1] < 0 && x[2] < 0 && x[3] < 0))
				cout << 0;
			else
				cout << 3;
		}
		else{
		if(abs(area(0, 0, x[1], y[1], x[2], y[2])) < 0.000000001 && (min(x[1], x[2]) <= 0 && max(x[1], x[2]) >= 0) && (min(y[1], y[2]) <= 0 && max(y[1], y[2]) >= 0))
			rez++;
		if(abs(area(0, 0, x[3], y[3], x[1], y[1])) < 0.000000001 && (min(x[1], x[3]) <= 0 && max(x[1], x[3]) >= 0) && (min(y[1], y[3]) <= 0 && max(y[1], y[3]) >= 0))
			rez++;
		if(abs(area(0, 0, x[2], y[2], x[3], y[3])) < 0.000000001 && (min(x[3], x[2]) <= 0 && max(x[3], x[2]) >= 0) && (min(y[3], y[2]) <= 0 && max(y[3], y[2]) >= 0)){
			rez++;
		}
		if(isInside(x[1], y[1], x[2], y[2], x[3], y[3], 0, 0))
			rez++;
		cout << rez;
		}
	}
	return 0;
}