#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }


/*
<url:>
問題文============================================================

=================================================================

解説=============================================================

================================================================
*/
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    ll N; cin >> N;
    vector<ll> a(N),b(N);
    for(auto& in:a) {cin >> in; in--;}
    for(auto& in:b) {cin >> in; in--;}
    set<ll> s(b.begin(),b.end());
    if(s.size() == N){
        cout << "Yes" << endl;
    }else{
        vector<int> f(N,0);
        for(auto it:s){
            f[it] = 1;
        }
        vector<ll> c(N),d(N);
        iota(c.begin(),c.end(),1);
        iota(d.begin(),d.end(),1);
        for(int i = 0; i < N;i++){
            if(f[a[i]] == 0){
                c[i] = i+1;
                if(i == 0) d[i] = 2;
                else d[i] = 1;
            }else{
                c[i] = i+1;
                d[i] = i+1;
            }
        }
        cout << "No" << endl;
        cout << c << endl;
        cout << d << endl;

    }
	return 0;
}


### Prompt

Develop a solution in cpp 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 "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }


/*
<url:>
問題文============================================================

=================================================================

解説=============================================================

================================================================
*/
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    ll N; cin >> N;
    vector<ll> a(N),b(N);
    for(auto& in:a) {cin >> in; in--;}
    for(auto& in:b) {cin >> in; in--;}
    set<ll> s(b.begin(),b.end());
    if(s.size() == N){
        cout << "Yes" << endl;
    }else{
        vector<int> f(N,0);
        for(auto it:s){
            f[it] = 1;
        }
        vector<ll> c(N),d(N);
        iota(c.begin(),c.end(),1);
        iota(d.begin(),d.end(),1);
        for(int i = 0; i < N;i++){
            if(f[a[i]] == 0){
                c[i] = i+1;
                if(i == 0) d[i] = 2;
                else d[i] = 1;
            }else{
                c[i] = i+1;
                d[i] = i+1;
            }
        }
        cout << "No" << endl;
        cout << c << endl;
        cout << d << endl;

    }
	return 0;
}


```