N = int(input())
tmp = []
for _ in range(N):
    tmp.append([int(i) for i in input().split()])

dp = []
dp.append([[0]])
for i in range(N - 1):
    t = dp[i] + [[i + 1]]
    for arr in dp[i]:
        if not any(tmp[j][0] * tmp[i + 1][0] + tmp[j][1] * tmp[i + 1][1] == 0 for j in arr):
            t.append(arr + [i + 1])
    dp.append(t)

print(len(dp[N - 1]) % 1000000007)