N=int(input())
A=[0]*N
B=[0]*N
for _ in range(N):
	A[_],B[_]=map(int,input().split())
S=0
for i in range(N):
	k=0
	l=0
	for j in range(i+1,N):
		if A[i]*A[j]+B[i]*B[j]==0:
			k=k+1
	S=S+2**(N-k-1-i)
S=S//2
ans=S%1000000007
print(ans)