import sys
import numpy as np
from collections import defaultdict

input = sys.stdin.buffer.readline
MOD = 1000000007
N = int(input())
dd = defaultdict(list)
count = 1
iwashi = np.array([list(map(int, input().split())) for _ in range(N)])


gcd = np.gcd(iwashi[:, 0], iwashi[:, 1])
iwashi = iwashi // np.array([gcd, gcd]).T
checked = [False] * N
zeros = 0
for i in range(N):
    if checked[i]:
        continue
    if iwashi[i][0] == iwashi[i][1] == 0:
        zeros += 1
        continue
    parallel = [i]
    vertical = []
    for j in range(i + 1, N):
        if checked[j]:
            continue
        if iwashi[j][0] == iwashi[j][1] == 0:
            zeros += 1
            checked[j] = True
            continue
        if np.dot(iwashi[i], iwashi[j]) == 0:
            vertical.append(j)
            checked[j] = True
        elif (iwashi[i] == iwashi[j]).all() or (iwashi[i] == iwashi[j] * (-1)).all():
            parallel.append(j)
            checked[j] = True
    p = len(parallel)
    v = len(vertical)
    count *= (pow(2, p, MOD) - 1) + (pow(2, v, MOD) - 1) + 1
    count %= MOD
count -= 1
count += zeros
print(count % MOD)
