import math 

MOD = 10**9 + 7
N = int(input())
ABC = []
for i in range(N):
    a, b = map(int, input().split())
    if a * b >=0 and a > 0:
        ABC.append([ math.atan2(abs(b),abs(a)), abs(a), abs(b),1])
    else:
        ABC.append([math.atan2(abs(a),abs(b)), abs(b), abs(a), -1])
ABC.sort()
current_arg = ABC[-1][0]
group = []
daiich = 0
daini = 0
while ABC:
    current = ABC.pop()
    if current[0] == current_arg:
        if current[3]==1:
            daiich += 1
        else:
            daini += 1
    else:
        group += [[daiich, daini]]
        daiich = 0
        daini = 0
        if current[3]==1:
            daiich += 1
        else:
            daini += 1
        if ABC:
            current_arg = ABC[-1][0]
else:
    group += [[daiich, daini]]
    daiich = 0
    daini = 0

ans = 1
for u, v in group:
    ans *= (2**u + 2**v -1)
    ans %= MOD
print(ans-1)