Jungle Game
문제
Denise is designing a rainforest themed board game. The goal of the game is for each player to form a team of two characters and complete various challenges.
There are different characters numbered from to . Each character has two attributes and (problem solving skill and strength). The numbers and are positive integers satisfying . Before the game starts, each player will pick two characters and to form a team. It is possible to pick two copies of the same character. The total problem solving skill and strength of the team will be and respectively.
In the game there are also challenge cards numbered from to . Each of these also has two attributes and . Denise has already designed the challenge cards and decided on the values of all numbers and . However, the rules of the game assume that it is not possible for a player to form a team whose problem solving skill and strength are both the same as one of the challenge cards. In other words, the situation
should never occur for any triple (note that can be equal to ).
The only thing left to do is to decide the distinct pairs such that and the situation above never happens.
입력
The first line contains the integer ().
The following lines contain the values of the challenge cards ().
출력
If there is no solution, print "NO". Otherwise, print "YES" followed by lines, each containing a pair of integers (). These pairs of integers must be distinct. In other words, you may not have two indices with and .
예제
예제 1
5 5 5 5 6 6 5 6 6 8 8
YES 2 2 1 1 1 2 2 1 1 3
예제 2
1 2 2
NO