#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for (int i = 0; i < (n); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    vector<int> a(n),b(n);
    rep(i,n){
        cin >> a[i];
        a[i]--;
    }
    vector<bool> c(n);
    rep(i,n){
        cin >> b[i];
        b[i]--;
        c[b[i]]=true;
    }
    bool f=true;
    int u,v;
    rep(i,n){
        if(!c[a[i]]){
            f=false;
            u=a[i];
        }
        else{
            v=a[i];
        }
    }
    if(f){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
        rep(i,n){
            cout << a[i]+1;
            if(i!=n-1){
                cout << " ";
            }
        }
        cout << endl;
        rep(i,n){
            if(a[i]==u){
                cout << v+1;
            }
            else{
                cout << a[i]+1;
            }
            if(i!=n-1){
                cout << " ";
            }
        }
        cout << endl;
    }
}

### 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>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for (int i = 0; i < (n); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    vector<int> a(n),b(n);
    rep(i,n){
        cin >> a[i];
        a[i]--;
    }
    vector<bool> c(n);
    rep(i,n){
        cin >> b[i];
        b[i]--;
        c[b[i]]=true;
    }
    bool f=true;
    int u,v;
    rep(i,n){
        if(!c[a[i]]){
            f=false;
            u=a[i];
        }
        else{
            v=a[i];
        }
    }
    if(f){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
        rep(i,n){
            cout << a[i]+1;
            if(i!=n-1){
                cout << " ";
            }
        }
        cout << endl;
        rep(i,n){
            if(a[i]==u){
                cout << v+1;
            }
            else{
                cout << a[i]+1;
            }
            if(i!=n-1){
                cout << " ";
            }
        }
        cout << endl;
    }
}

```