#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n;
ll a[100100],b[100100];
set<ll> sl;

int main() {
	cin >> n;
	rep(i, n)cin >> a[i];
	rep(i, n) {
		cin >> b[i];
		sl.insert(b[i]);
	}
	bool f = 1;
	vector<ll> vl[2];
	rep(i, n) {
		vl[0].push_back(a[i]);
		if (sl.find(a[i]) != sl.end()) {
			vl[1].push_back(a[i]);
		}
		else {
			f = 0;
			if (i != 0)vl[1].push_back(a[0]);
			else vl[1].push_back(a[1]);
		}
	}
	if (f)cout << "Yes" << endl;
	else {
		cout << "No" << endl;
		rep(j, 2) {
			rep(i, n) {
				if (i != 0)cout << " ";
				cout << vl[j][i];
			}
			cout << endl;
		}
	}
}

### Prompt

Please provide a CPP coded solution 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 <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n;
ll a[100100],b[100100];
set<ll> sl;

int main() {
	cin >> n;
	rep(i, n)cin >> a[i];
	rep(i, n) {
		cin >> b[i];
		sl.insert(b[i]);
	}
	bool f = 1;
	vector<ll> vl[2];
	rep(i, n) {
		vl[0].push_back(a[i]);
		if (sl.find(a[i]) != sl.end()) {
			vl[1].push_back(a[i]);
		}
		else {
			f = 0;
			if (i != 0)vl[1].push_back(a[0]);
			else vl[1].push_back(a[1]);
		}
	}
	if (f)cout << "Yes" << endl;
	else {
		cout << "No" << endl;
		rep(j, 2) {
			rep(i, n) {
				if (i != 0)cout << " ";
				cout << vl[j][i];
			}
			cout << endl;
		}
	}
}

```