import math
import bisect
N = int(input())
atans =  [0 for _ in range(N)]
for i in range(N):
  A, B = map(int, input().split())
  if A == 0:
    atans[i] = 90
  else:
    atans[i] = math.degrees(math.atan(A/B))

atans.sort()
index0 = bisect.bisect_left(atans, 0)
if (index0==0) or (index0==N):
  print(pow(2, N, 1000000007) -1)
  exit()

left = atans[:index0]
right = atans[index0:]
ans = 1

lenleft = index0
lenright = N - index0
now = -90
for i in range(index0):
  if left[i]==now:
    continue
  now = left[i]
  target = now+90
  same1 = bisect.bisect_right(right, target) - bisect.bisect_left(right, target)
  
  if same1 >= 1:
    lenright -= same1
    same2 = bisect.bisect_right(left, now) - bisect.bisect_left(left, now)
    ans = ans * (pow(2,same1,1000000007)+pow(2,same2,1000000007)-1) %1000000007
  else:
    ans = ans * 2 %1000000007

ans = (ans * pow(2, lenright, 1000000007) -1) % 1000000007
print(ans)