# --*- coding: utf-8 -*-
# 標準入力の取得
N = int(input())
A, B = [], []
for n in range(N):
    A_n, B_n = list(map(int, input().split()))
    A.append(A_n)
    B.append(B_n)

# 求解処理
sardines = list(range(N))
result = 1
while len(sardines) >= 0:
    if len(sardines) == 1:
        result *= 2
        break
    i = sardines[0]
    A_i = A[i]
    B_i = B[i]
    group = [i]
    for j in sardines[1:]:
        A_j = A[j]
        B_j = B[j]
        if (A_i*A_j + B_i*B_j == 0) or (A_i*B_j == A_j*B_i):
            group.append(j)
    result *= len(group) + 1
    print(group)
    for g in group:
        sardines.remove(g)

print((result - 1) % 1000000007)
