import math
import numpy as np
N=int(input())
L=[list(map(int,input().split())) for i in range(N)]
#print(L)
ratio = [None] * N
for i in range(N):
  if L[i][0] == 0 and L[i][1]>=0:
    L[i].append(math.pi/2)
    ratio[i]=round(math.pi/2,17)
  elif L[i][0] == 0 and L[i][1]<0:
    L[i].append(math.pi/2)
    ratio[i]=round(3*math.pi/2,17)
  else:
    L[i].append(math.atan(L[i][1]/L[i][0]))
    ratio[i] = round(math.atan(L[i][1]/L[i][0]),17)
#print(ratio)
#print(L)
#np_L=np.array(L)
#print(np_L)
#np_sort=np_L[np.argsort(np_L[:,-1])]
ratio.sort()

import bisect
cnt = 0
for i in range(N):
  if ratio[i] >= math.pi *3/2:
    if bisect.bisect(ratio,ratio[i]-round(3*math.pi/2,10)) >= 0:
    cnt += 1
  else:
    if bisect.bisect(ratio,ratio[i]+round(math.pi/2,10)) >= 0:
      cnt += 1

print(pow(2,N-2*cnt,mod)*(1+pow(2,m,mod))-1)

