#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)

void solve() {
	int n; cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	rep(i, n)cin >> a[i];
	rep(i, n)cin >> b[i];
	vector<int> used(n + 1);
	rep(i, n) {
		used[b[i]] = 1;
	}
	int cnt = 0;
	rep(i, n) {
		cnt += used[i + 1];
	}
	if (cnt == n) {
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
	rep(i, n-1)cout << 1 <<" ";
	cout <<1<< endl;
	rep(i, n) {
		if (used[a[i]])cout << 1;
		else cout << 2 ;
		if (i != n - 1)cout << " ";
	}
	cout << endl;
	return;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

### Prompt

Your task is to create a cpp solution 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<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)

void solve() {
	int n; cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	rep(i, n)cin >> a[i];
	rep(i, n)cin >> b[i];
	vector<int> used(n + 1);
	rep(i, n) {
		used[b[i]] = 1;
	}
	int cnt = 0;
	rep(i, n) {
		cnt += used[i + 1];
	}
	if (cnt == n) {
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
	rep(i, n-1)cout << 1 <<" ";
	cout <<1<< endl;
	rep(i, n) {
		if (used[a[i]])cout << 1;
		else cout << 2 ;
		if (i != n - 1)cout << " ";
	}
	cout << endl;
	return;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

```