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(total):
    if i != j:
      if l[i][0]*l[j][0] + l[j][1]*l[i][1] != 0:
        
        result = result + 1
result = int(result/2) + total

print(result % 1000000007)