import math
import itertools
count = int(input())
com = []
counter = 0
for j in range(count):
    com.append(input().split())
for i in itertools.combinations(com,r=2):
    counter += 1
    if int(i[0][0])*int(i[0][1]) + int(i[1][0])*int(i[1][1]) == 0:
        counter -= 1
print((counter + count)%1000000007)