N=int(input())
A=[]
B=[]
for i in range(N):
  ab=list(map(int,input().split()))
  A.append(ab[0])
  B.append(ab[1])

S=[]
for i in range(N):
  s=1
  for j in range(i+1,N):
    if A[i]*A[j]+B[i]*B[j]!=0:
      s=s*2
  S.append(s)
  
print(sum(S)%1000000007)