#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	cin >> N;
	vector<int>a(N);
	vector<int>b(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> M;
		b[M]++;
	}
	bool flag = true;
	for (int i = 1; i <= N; i++) {
		if (b[i] != 1) {
			flag = false;
			break;
		}
	}
	if (flag) {
		cout << "Yes\n";
		return 0;
	}
	cout << "No\n";
	vector< int > g(N + 1);
	vector< int > f(N + 1);
	for (int i = 1; i <= N; i++) {
		if (b[i]) {
			f[i] = 1;
			g[i] = 1;
		}
		else {
			f[i] = 1;
			g[i] = 2;
		}
	}
	for (int i = 0; i < N; i++) {
		if (i) {
			cout << " ";
		}
		cout << f[a[i]];
	}
	cout << endl;
	for (int i = 0; i < N; i++) {
		if (i) {
			cout << " ";
		}
		cout << g[a[i]];
	}
	cout << endl;
	return 0;
}

### Prompt

Please create a solution in CPP 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 "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	cin >> N;
	vector<int>a(N);
	vector<int>b(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> M;
		b[M]++;
	}
	bool flag = true;
	for (int i = 1; i <= N; i++) {
		if (b[i] != 1) {
			flag = false;
			break;
		}
	}
	if (flag) {
		cout << "Yes\n";
		return 0;
	}
	cout << "No\n";
	vector< int > g(N + 1);
	vector< int > f(N + 1);
	for (int i = 1; i <= N; i++) {
		if (b[i]) {
			f[i] = 1;
			g[i] = 1;
		}
		else {
			f[i] = 1;
			g[i] = 2;
		}
	}
	for (int i = 0; i < N; i++) {
		if (i) {
			cout << " ";
		}
		cout << f[a[i]];
	}
	cout << endl;
	for (int i = 0; i < N; i++) {
		if (i) {
			cout << " ";
		}
		cout << g[a[i]];
	}
	cout << endl;
	return 0;
}

```