#include <stdio.h>

int main(){
  int n;  scanf("%d", &n);
  long a[200005], b[200005];
  int mm[200005] = {0};
  int pp[200005] = {0};
  int mp[200005] = {0};
  int pm[200005] = {0};
  long count = 0;
  long mod = 1000000007;
  
  for(int i=1; i<=n; i++){
    scanf("%ld %ld", &a[i], &b[i]);
    if(a[i]<0 && b[i]<0){
      mm[++mm[0]] = i;
    }else if(a[i]<0 && b[i]>=0){
      mp[++mp[0]] = i;
    }else if(a[i]>=0 && b[i]<0){
      pm[++pm[0]] = i;
    }else{
      pp[++pp[0]] = i;
    }
  }
  for(int i=1; i<=pp[0]; i++){
    for(int j=1; j<=pm[0]; j++)
      if(a[pp[i]]*a[pm[j]] + b[pp[i]]*b[pm[j]] == 0)
	count = (count + 1) % mod;
    for(int j=1; j<=mp[0]; j++)
      if(a[pp[i]]*a[mp[j]] + b[pp[i]]*b[mp[j]] == 0)
	count = (count + 1) % mod;
  }
  
  for(int i=1; i<=mm[0]; i++){
    for(int j=1; j<=pm[0]; j++)
      if(a[mm[i]]*a[pm[j]] + b[mm[i]]*b[pm[j]] == 0)
	count = (count + 1) % mod;
    for(int j=1; j<=mp[0]; j++)
      if(a[mm[i]]*a[mp[j]] + b[mm[i]]*b[mp[j]] == 0)
	count = (count + 1) % mod;
  }
  
      
      
  return 0;
}
