import numpy as np
N = int(input())
List = []
ls_append = List.append
for i in range(N):
  a,b = map(int, input().split())
  ls_append([a,b])
 
count = 0

for i in range(N):
  for j in range(N):
    if i >= j:
      dots = np.dot(List[i],List[j])
      if dots != 0:
        count +=1
      else:
        pass
    else:
      pass
    
print(count % 1000000007)