p01975 Mapping
problem

AOR Ika made a set $ S = \\ {a_1, ..., a_N \\} $ and a map $ f: S → S $. $ f (a_i) = b_i $. For any element $ x $ in the set $ S $, all maps $ g, h: S → S $ satisfying $ g (f (x)) = h (f (x)) $ are $ g (x). ) = Determine if h (x) $ is satisfied, and if not, configure one counterexample.





Example

Input

5
1 2 3 4 5
3 4 2 5 1


Output

Yes
```python
# -*- coding: utf-8 -*-
from collections import Counter
def inpl(): return list(map(int, input().split()))
N = int(input())
A = inpl()
Ai = range(N)
Ad = {a:i for i, a in enumerate(A)}
F = inpl()

C = [0]*N
for f in F:
    C[Ad[f]] += 1

if not 0 in C:
    print("Yes")
else:
    print("No")
    print(*list(map(str, A)))
    lack = C.index(0)
    ans = A[:lack] + [A[lack-1]] + A[lack+1:]
    print(*ans)


```