# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
AB = [lr() for _ in range(N)]
graph = [set() for _ in range(N+1)]  # 1-indexed 仲が悪い組み合わせ
#print(AB)
for i in range(1, N+1):
    for j in range(i+1, N+1):
        ai, bi = AB[i-1]
        aj, bj = AB[j-1]
        if ai * aj + bi * bj == 0:
            graph[i].add(j)
print(graph)
MOD = 1000000007
answer = 0
#used = set()
for i in range(1, N+1):
    #graph[i] -= used
    x = N - i - (len(graph[i]))  # xの中から自由に選ぶ、自分は既に入っているので0もあり
    answer += pow(2, x, MOD)
    answer %= MOD
    print('i', i, answer)
    #used.add(i)

print(answer % MOD)
# np.int64とint型の違いに注意