시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB53375.000%

문제

The 9-th grade students are doing Physical Education, they have just run a long distance. The lesson is approaching its end, so the teacher asked students to stand in a line in non-decreasing order of their heights. Students don't always pay their attention, so sometimes they stand in a line not in the order they were asked. The teacher wants to fix the problem.

The teacher looks at the line, and if it's not ordered properly, chooses the $i$-th and the $j$-th student in the line, and swaps them. So after the swap, a the $i$-th student becomes the $j$-th student, and the other way around. Teacher keeps doing swaps, until the line is ordered properly. Formally speaking, until for all $i$ --- the $(i+1)$-th student is not shorter than the $i$-th student in the line.

Although today it won't be easy for the teacher. Students are very tired after the run so they can hardly stand. The teacher doesn't want to overload them physically, so the teacher won't move any student more than once.

The teacher needs your help. You are given the line: $a_1, a_2, \ldots, a_n$ --- the heights of the students. Find the sequence of swaps for teacher to make the line ordered properly, or say that it's not possible.

입력

The first line contains an integer $n$ --- the number of students ($1 \le n \le 2 \cdot 10^5$).

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \le a_i \le 10^9$). The number $a_i$ is the height of the $i$-th student in the line.

출력

If the teacher won't be able to order the students properly, print "No".

Otherwise, print "Yes" in the first line. In the second line print an integer $k$ --- the number of swaps the teacher needs to make. In each of the next $k$ lines print two integers $i$ and $j$, denoting that the teacher should swap the $i$-th and the $j$-th students in the line.

Note that you don't have to minimize the number of swaps. You can print any sequence that will make the line ordered properly in a way that no student was swapped more than once.

서브태스크

번호배점제한
121

$n \le 10$, $a_i \le 100$

219

$n \le 2 \cdot 10^5$, $a_i \le 10^9$, all $a_i$ are distinct

323

$n \le 2 \cdot 10^5$, $a_i \le 100$

437

$n \le 2 \cdot 10^5$, $a_i \le 10^9$

예제 입력 1

3
3 2 1

예제 출력 1

Yes
1
3 1

예제 입력 2

6
2 5 5 2 10 9

예제 출력 2

Yes
2
5 6
2 4

예제 입력 3

5
2 3 4 5 1

예제 출력 3

No

채점 및 기타 정보

  • 예제는 채점하지 않는다.