#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
int a[100001];
int b[100001];
int f[100001];
bool flag[100001];
int ans[2][100001];
int ans2[2][100001];
int ra[100001]; 

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
		a[i]--;
		ra[a[i]]=i;
	}
	for(int i=0;i<n;i++){
		scanf("%d",&b[i]);
		b[i]--;
		flag[b[i]]=true;
	}
	for(int i=0;i<n;i++){
		f[a[i]]=b[i];
	}
	for(int i=0;i<n;i++){
		ans[0][f[i]]=1;
		ans[1][f[i]]=1;
	}
	bool ft=true;
	for(int i=0;i<n;i++){
		if(ans[0][i]==0)ans[0][i]=2;
		if(ans[1][i]==0)ans[1][i]=1;
		if(ans[0][i]!=ans[1][i])ft=false;
	}
	if(ft){
		puts("Yes");
		return 0;
	}
	puts("No");
	for(int i=0;i<n;i++){
		printf("%d%c",ans[0][a[i]],i+1==n?'\n':' ');
	}
	for(int i=0;i<n;i++){
		printf("%d%c",ans[1][a[i]],i+1==n?'\n':' ');
	}
	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 <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
int a[100001];
int b[100001];
int f[100001];
bool flag[100001];
int ans[2][100001];
int ans2[2][100001];
int ra[100001]; 

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
		a[i]--;
		ra[a[i]]=i;
	}
	for(int i=0;i<n;i++){
		scanf("%d",&b[i]);
		b[i]--;
		flag[b[i]]=true;
	}
	for(int i=0;i<n;i++){
		f[a[i]]=b[i];
	}
	for(int i=0;i<n;i++){
		ans[0][f[i]]=1;
		ans[1][f[i]]=1;
	}
	bool ft=true;
	for(int i=0;i<n;i++){
		if(ans[0][i]==0)ans[0][i]=2;
		if(ans[1][i]==0)ans[1][i]=1;
		if(ans[0][i]!=ans[1][i])ft=false;
	}
	if(ft){
		puts("Yes");
		return 0;
	}
	puts("No");
	for(int i=0;i<n;i++){
		printf("%d%c",ans[0][a[i]],i+1==n?'\n':' ');
	}
	for(int i=0;i<n;i++){
		printf("%d%c",ans[1][a[i]],i+1==n?'\n':' ');
	}
	return 0;
}

```