using System;
using System.IO;
using System.Collections.Generic;

public class MainApp
{
    static int many,check;
    
    static int iwashi;

    static public void Main(string[] args)
    {
        many = 0;
        check = 0;
        iwashi = int.Parse(Console.ReadLine());

        int[] smell = new int[iwashi], deli = new int[iwashi];

        //入力
        for (int i = 0; i < iwashi; i++)
        {
            var line = Console.ReadLine();
            var temp_input = line.Split(new Char[0],StringSplitOptions.RemoveEmptyEntries);
            deli[i] = int.Parse(temp_input[0]);
            smell[i] = int.Parse(temp_input[1]);
        }
        
        for (int i = 0; i <= iwashi; i++)
        {
            for (int j = 0; j <= iwashi; j++)
            {
                if (i != j)
                {
                    check = ( deli[i] * deli[j] ) + ( smell[i] * smell[j] );
                    if (check != 0)
                    {
                        many++;
                    }
                }
            }
        }
        Console.WriteLine(many % 1000000007);

    }
}