#include<stdio.h>

int main(void){

  long N,x, A[200000], B[200000];
  int i,j,n = 0;
  
  scanf("%ld", &N);

  for(i = 1; i <= N; i++){
    scanf("%ld %ld", &A[i - 1], &B[i - 1]);
  }

  for(i = 0; i < N; i++){
    for(j = 0; j < N; j++){
      if(i != j){
        if(A[i] * A[j] + B[i] * B[j] == 0){
          n++;
        }
      }
    }
  }

  x = N * N - N - n;

  printf("%ld\n", x / 1000000007);

  return 0;
}
