Chef has $N$ markers. There is a cap on each marker. For each valid $i$, the $i$-th marker has colour $a_i$. Initially, for each valid $i$, the colour of the cap on the $i$-th marker is also $a_i$.
Chef wants to rearrange the caps in such a way that no marker has the same colour as its cap. (Obviously, each marker must have exactly one cap.) Can he do that? If he can, find one such way to rearrange the caps. If there are multiple solutions, you may find any one.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single integer $N$.
- The second line contains $N$ space-separated integers $a_1, a_2, \ldots, a_N$.

-----Output-----
- For each test case:
- If Chef cannot successfully rearrange the caps, print a single line containing the string "No" (without quotes).
- Otherwise, print two lines. The first line should contain the string "Yes" (without quotes). The second line should contain $N$ space-separated integers describing a valid rearrangement of caps. For each valid $i$, the $i$-th of these integers should denote the final colour of the cap on the $i$-th marker.

-----Constraints-----
- $1 \le T \le 10$
- $1 \le N \le 10^5$
- $1 \le a_i \le 10^9$ for each valid $i$

-----Example Input-----
2
9
1 1 1 2 2 2 3 3 3
2
1 1

-----Example Output-----
Yes
2 2 2 3 3 3 1 1 1
No

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "for _ in range(int(input())):\n n=int(input())\n d={};b=[0]*n;g={};h={}\n a=list(map(int,input().split()))\n for i in range(n):\n  if a[i] in d:\n   d[a[i]]+=1\n   h[a[i]].append(i)\n  else:\n   d[a[i]]=1\n   h[a[i]]=[i]\n x=list(map(list,sorted(list(d.items()),key=lambda y:y[1])))\n #print(x)\n l=0;r=len(x)-1\n \n for i in d:\n  g[i]=[]\n \n while l<r:\n  if x[r][1]>=x[l][1]:\n   g[x[r][0]].append([x[l][0],x[l][1]])\n   g[x[l][0]].append([x[r][0],x[l][1]])\n   x[r][1]-=x[l][1]\n   x[l][1]=0\n   l+=1\n  else:\n   if x[r][1]>0:\n    g[x[r][0]].append([x[l][0],x[r][1]])\n    g[x[l][0]].append([x[r][0],x[r][1]])\n    x[l][1]-=x[r][1]\n    x[r][1]=0\n   r-=1\n #print(g)\n s=[];m=x[-1][0];k=-1\n for i in range(n):\n  if g[a[i]]!=[]:\n   b[i]=g[a[i]][-1][0]\n   g[a[i]][-1][1]-=1\n   if g[a[i]][-1][1]==0:\n    g[a[i]].pop()\n  else:\n   s.append(i);k=a[i]\n #print(b)\n if k==m:\n  print('No')\n else:\n  for i in h[m]:\n   if b[i]!=k:\n    if s!=[]:\n     b[s.pop()]=b[i]\n     b[i]=k\n  print('Yes')\n  print(*b)\n  \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14823