#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    set<int> b;
    map<int, int> cnv;
    rep(i, N) cin >> a[i];
    rep(i, N) cnv[a[i]] = i;
    rep(i, N) {
        int t;
        cin >> t;
        b.insert(t);
    }
    if (a.size() == b.size()) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
        vector<int> c(N), d(N);
        rep(i, N) {
            if (b.count(a[i])) {
                d[cnv[a[i]]] = c[cnv[a[i]]] = 1;
            } else {
                d[cnv[a[i]]] = 1;
                c[cnv[a[i]]] = 2;
            }
        }
        rep(i, N) cout << c[i] << (i + 1 == N ? "" : " ");
        cout << endl;
        rep(i, N) cout << d[i] << (i + 1 == N ? "" : " ");
        cout << endl;
    }

    return 0;
}


### Prompt

Develop a solution in Cpp to the problem described below:

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;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    set<int> b;
    map<int, int> cnv;
    rep(i, N) cin >> a[i];
    rep(i, N) cnv[a[i]] = i;
    rep(i, N) {
        int t;
        cin >> t;
        b.insert(t);
    }
    if (a.size() == b.size()) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
        vector<int> c(N), d(N);
        rep(i, N) {
            if (b.count(a[i])) {
                d[cnv[a[i]]] = c[cnv[a[i]]] = 1;
            } else {
                d[cnv[a[i]]] = 1;
                c[cnv[a[i]]] = 2;
            }
        }
        rep(i, N) cout << c[i] << (i + 1 == N ? "" : " ");
        cout << endl;
        rep(i, N) cout << d[i] << (i + 1 == N ? "" : " ");
        cout << endl;
    }

    return 0;
}


```