There are n cards on the table. Each card has two numbers written on it — the card rank and the serial number. You should form a deck:
Calculate the total cost in coins of all possible decks. Two decks are considered to be different if there is a card that enters one deck and does not enter another. However, different cards can have the same rank and serial number.
The first line contains integer n — total amount of cards on the table .
Each of the following n rows contains two integers si (i-th card rank) and ki (i-th card serial number).
You are required to output a total cost in coins of all possible decks modulo 109 + 7.
6
8 8
5 9
9 4
3 9
3 1
7 5
42
| Name |
|---|


