import math
from collections import Counter

mod = 10**9+7
n = int(input())
c = Counter()
cc = Counter()

iwashi = []
for _ in range(n):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        c[-1] += 1
        continue
    rad = round(math.degrees(math.atan2(a, b)), 10)
    if rad - 180 == 0:
        rad = 0
    if rad < 0:
        rad += 180
    iwashi.append([a, b, rad])
    c[rad] += 1
    cc[rad] += 1


l = []

for r in cc.keys():
    if r == -1:
        continue
    if 0 <= r < 90:
        ra = c[r]
        rb = c[r+90]
        if ra >= 0 and rb >= 0:
            l.append([ra, rb])
        c[r] -= 10**9
        c[r+90] -= 10**9
    else:
        ra = c[r-90]
        rb = c[r]
        if ra >= 0 and rb >= 0:
            l.append([ra, rb])
        c[r-90] -= 10**9
        c[r] -= 10**9

ans = 1

for a, b in l:
    ans *= pow(2, a, mod)-1 + pow(2, b, mod)-1 + 1
    ans %= mod

ans = (ans-1) + c[-1]
ans %= mod

print(ans)
