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

mod = 1000000007
eps = 0.001

n = int(input())

ab = []
ang = []
for i in range(n):
    a,b = map(int,input().split())
    ab.append((a,b))
    if a == 0:
        ang.append((90.0,i))
    else:
        ang.append((math.degrees(math.atan(b/a)),i))
ang.sort()

res = 1
used = [False]*n


rest = n

for i in range(n):
    e,idx = ang[i]
    if used[idx]:
        continue
    used[idx] = True
    
    cnt = 1
    k = idx + 1
    while k < n:
        if abs(e-ang[k][0]) <= eps:
            p = ang[k][1]
            if ab[p][0]*ab[idx][1] == ab[p][1]*ab[idx][0]:
                cnt += 1
                used[p] = True
            k += 1
        else:
            break


    cnt2 = 0

    ok = n-1
    ng = i+1
    while ok-ng > 1:
        mid = (ok+ng)//2
        if ang[mid][0] >= e+90-eps:
            ok = mid
        else:
            ng = mid

    k = ok
    while k < n:
        if abs(e+90-ang[k][0]) <= 0.002:
            p = ang[k][1]
            if ab[p][0]*ab[idx][0] + ab[p][1]*ab[idx][1] == 0:
                cnt2 += 1
                used[p] = True
            k += 1
        else:
            break

    if cnt2 != 0:
        res = res*(pow(2,cnt,mod) + pow(2,cnt2,mod) - 1)%mod
        rest -= cnt+cnt2

res = res*pow(2,rest,mod)%mod - 1
print(res)



