total = int(input())

l = [[0 for j in range(2)] for i in range(total)]

for i in range(total):
    a, b = map(int, input().split())
    l[i] = [a,b]

result = 0

for i in range(total):
  for j in range(i,total):
    if l[i][0]*l[j][0] + l[j][1]*l[i][1] != 0:  
      result = result + 1

print(result % 1000000007)

