N = int(input())
A, B =[]
for i in range(N):
  a,b = map(int, input().split())
  A.append(a)
  B.append(b)

count = 0
for i in range(N):
  for j in range(N):
    pair = a[i]*a[j] + b[i]*b[j]
    if pair != 0:
      count += 1
    else:
      pass
    
print(count % 1000000007)