#include <stdio.h>

int main(void)
{
	int N,i,j;
	long long answer=0,S[200000][200000],A[200000],B[200000],total[200000],l;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		total[i]=N-i-1;
		scanf("%lld",&A[i]);
		scanf("%lld",&B[i]);
	}
	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			if(A[i]*A[j]+B[i]*[j]==0)total[i]--;
		}
	}
	for(i=0;i<N;i++){
		l=1;
		for(j=0;j<total[i];j++){
			l=l*2;
			if(l>=1000000007)l=l%1000000007;
		}
		answer+=l;
		if(answer>=1000000007)answer=answer%1000000007;
	}
	printf("%lld",answer);
	return 0;
}