#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int a[100000];
int b[100000];
int pos[100000];
int cnt[100000];
int diff[100000];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> a[i];
		a[i]--;
		pos[a[i]] = i;
	}
	for(int i = 0; i < N; i++){
		cin >> b[i];
		b[i]--;
		cnt[b[i]]++;
	}

	bool flag = 0;
	for(int i = 0; i < N; i++){
		if(cnt[i] == 0){
			diff[pos[i]] = 1;
			flag = 1;
		}
	}

	if(flag){
		cout << "No" << endl;
		for(int i = 0; i < N; i++){
			cout << i + 1;
			if(i != N - 1) cout << " ";
		}
		cout << endl;

		for(int i = 0; i < N; i++){
			if(diff[i]){
				cout << (i + 1) % N + 1;
			}
			else{
				cout << i + 1;
			}
			if(i != N - 1) cout << " ";
		}
		cout << endl;
	}
	else{
		cout << "Yes" << endl;
	}
}


### Prompt

In Cpp, your task is to solve 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;
typedef long long ll;

int a[100000];
int b[100000];
int pos[100000];
int cnt[100000];
int diff[100000];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> a[i];
		a[i]--;
		pos[a[i]] = i;
	}
	for(int i = 0; i < N; i++){
		cin >> b[i];
		b[i]--;
		cnt[b[i]]++;
	}

	bool flag = 0;
	for(int i = 0; i < N; i++){
		if(cnt[i] == 0){
			diff[pos[i]] = 1;
			flag = 1;
		}
	}

	if(flag){
		cout << "No" << endl;
		for(int i = 0; i < N; i++){
			cout << i + 1;
			if(i != N - 1) cout << " ";
		}
		cout << endl;

		for(int i = 0; i < N; i++){
			if(diff[i]){
				cout << (i + 1) % N + 1;
			}
			else{
				cout << i + 1;
			}
			if(i != N - 1) cout << " ";
		}
		cout << endl;
	}
	else{
		cout << "Yes" << endl;
	}
}


```