#include<bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int a(i),b(i);
    cin>>a(i)>>b(i);
  }
  
  int count==0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a(i)*a(j)+b(i)*b(j)!=0)
        count++;
    }

  }
    cout<<count%1000000007<<endl;
}
