n = int(input(''))
sardines = []
count = 0

for i in range (0, n):
    x = input("").split()
    x = [int(i) for i in x]
    sardines.append([x[0], x[1]])


for k in range(0, n):
    for l in range(k + 1, n):
        if sardines[k][0] * sardines[l][0] + sardines[k][1] * sardines[l][1] != 0:
            count += 1
count += n
print(count % 1000000007)