<?php
fscanf(STDIN, "%d", $n);

$ab = [];
for ($i = 0;$i <$n;$i++) {
  fscanf(STDIN, "%d %d", $a, $b);
  $ab[] = ["a" => $a,"b" => $b];
}

$cnt = 0;
for($i = 0;$i < $n;$i++){
  for($j = 0;$j < $n;$j++){
    if($i < $j) continue;
    if($ab[$i]["a"] * $ab[$j]["a"]
       +
       $ab[$i]["b"] * $ab[$j]["b"] !== 0) {
       $cnt++;
    }
  }
}
echo $cnt % 1000000007;