import sys,math,bisect
input = sys.stdin.readline

mod = 1000000007
eps = 0.0000000000001

n = int(input())

ab = []
ang = []
half = math.pi/2.0
zero = 0

for i in range(n):
    a,b = map(int,input().split())
    ab.append((a,b))
    if a == 0 and b == 0:
        zero += 1
    elif a == 0:
        ang.append(half)
    else:
        ang.append(math.atan(b/a))
ang.sort()

n -= zero

res = 1
rest = n

i = 0
while True:
    if i >= n:
        break
    val = ang[i]
    if val > 2*eps:
        break
    cnt = bisect.bisect_right(ang,val+eps) - i
    cnt2 = bisect.bisect_right(ang,val+half+eps) - bisect.bisect_left(ang,val+half-eps)
    if cnt2 > 0:
        rest = rest - cnt - cnt2
        res = res*(pow(2,cnt,mod) + pow(2,cnt2,mod) - 1)%mod
    i += cnt
rest = max(rest,0)
res = res*pow(2,rest,mod)%mod - 1 + zero
print(res%mod)

