n=int(input())
lst=[list(map(int,input().split())) for i in range(n)]
count=0
for x in lst:
  for y in lst:
    if x!=y:
      if (x[0]*y[0]+x[1]*y[1])==0:
        count+=1
print((2**n-(count//2)*2**(n-2))%1000000007)
