#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>

using namespace std;

void solve(int N, vector<int> a, vector<int> b) {
    vector<int> used(N+1, 0);
    for (int i = 0; i < N; i++) {
        used[b[i]] = 1;
    }
    int target = -1;
    for (int i = 1; i < N+1; i++) {
        if (used[i] == 0) {
            target = i;
        }
    }
    if (target == -1) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
        for (int i = 0; i < N-1; i++) {
            std::cout << 1 << ' ';
        }
        std::cout << 1 << std::endl;
        for (int i = 0; i < N; i++) {
            if (i > 0) {
                std::cout << ' ';
            }
            if (a[i] == target) {
                std::cout << 2;
            } else {
                std::cout << 1;
            }
        }
        std::cout << std::endl;
    }
}

int main() {
    int N;

    std::cin >> N;
    vector<int> a(N);
    vector<int> b(N);
    for (int i = 0; i < N; i++) {
        std::cin >> a[i];
    }
    for (int i = 0; i < N; i++) {
        std::cin >> b[i];
    }
    solve(N, a, b);

    return 0;
}


### Prompt

Construct a cpp code solution to the problem outlined:

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 <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>

using namespace std;

void solve(int N, vector<int> a, vector<int> b) {
    vector<int> used(N+1, 0);
    for (int i = 0; i < N; i++) {
        used[b[i]] = 1;
    }
    int target = -1;
    for (int i = 1; i < N+1; i++) {
        if (used[i] == 0) {
            target = i;
        }
    }
    if (target == -1) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
        for (int i = 0; i < N-1; i++) {
            std::cout << 1 << ' ';
        }
        std::cout << 1 << std::endl;
        for (int i = 0; i < N; i++) {
            if (i > 0) {
                std::cout << ' ';
            }
            if (a[i] == target) {
                std::cout << 2;
            } else {
                std::cout << 1;
            }
        }
        std::cout << std::endl;
    }
}

int main() {
    int N;

    std::cin >> N;
    vector<int> a(N);
    vector<int> b(N);
    for (int i = 0; i < N; i++) {
        std::cin >> a[i];
    }
    for (int i = 0; i < N; i++) {
        std::cin >> b[i];
    }
    solve(N, a, b);

    return 0;
}


```