#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for (ll i = 0, i##_len = (n); i < i##_len; i++)

int main() {

    ll n; cin >> n;
    vector<ll> a(n), b(n);
    REP(i, n) cin >> a[i];
    REP(i, n) cin >> b[i];

    auto bb = b;
    sort(bb.begin(), bb.end());
    bb.erase(unique(bb.begin(), bb.end()), bb.end());
    if (bb.size() == n) {
        cout << "Yes" << endl;
        return 0;
    } else {
        cout << "No" << "\n";
        vector<ll> c(n, a[0]), d(n, a[1]);
        map<ll, ll> im;
        REP(i, n) im[a[i]] = i;
        for (ll bi : b) {
            c[im[bi]] = d[im[bi]] = a[0];
        }
        REP(i, n) cout << c[i] << " \n"[i+1 == n];
        REP(i, n) cout << d[i] << " \n"[i+1 == n];
        cout << flush;
    }

}

### Prompt

Generate a Cpp solution to the following problem:

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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for (ll i = 0, i##_len = (n); i < i##_len; i++)

int main() {

    ll n; cin >> n;
    vector<ll> a(n), b(n);
    REP(i, n) cin >> a[i];
    REP(i, n) cin >> b[i];

    auto bb = b;
    sort(bb.begin(), bb.end());
    bb.erase(unique(bb.begin(), bb.end()), bb.end());
    if (bb.size() == n) {
        cout << "Yes" << endl;
        return 0;
    } else {
        cout << "No" << "\n";
        vector<ll> c(n, a[0]), d(n, a[1]);
        map<ll, ll> im;
        REP(i, n) im[a[i]] = i;
        for (ll bi : b) {
            c[im[bi]] = d[im[bi]] = a[0];
        }
        REP(i, n) cout << c[i] << " \n"[i+1 == n];
        REP(i, n) cout << d[i] << " \n"[i+1 == n];
        cout << flush;
    }

}

```