시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB112372435.294%

문제

Grammy has a sequence $A$ of length $n$.

Please find a permutation $P$ such that $P_i \neq A_i$ for all $i$.

입력

There are multiple test cases.

The first line contains a single integer $T$ ($1 \leq T \leq 100\,000$), denoting the number of test cases.

For each test case:

The first line contains a single integer $n$ ($1 \leq n \leq 100\,000$).

The second line contains $n$ integers $A_1,A_2,\ldots,A_n$ ($1 \leq A_i \leq n$).

It is guaranteed that the sum of $n$ does not exceed $500\,000$.

출력

For each test case:

If the permutation does not exist, output "NO" on a single line.

Otherwise, output "YES" one the first line, then output $n$ integers one the second line, denoting the permutation $P_1,P_2,\ldots,P_n$.

예제 입력 1

3
3
3 3 3
3
3 2 1
6
1 1 4 5 1 4

예제 출력 1

NO
YES
1 3 2
YES
4 5 1 2 3 6