#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

int main(){
    int n;
    cin>>n;
    
    vector<int> a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    
    set<int> st;
    rep(i,b.size())st.insert(b[i]);
    
    if(st.size()==n){
        cout<<"Yes"<<endl;
        return 0;
    }else{
        cout<<"No"<<endl;
        int bx = -1;
        for(int i=1;i<=n;i++){
            if(st.count(i)==0){
                bx = i;
            }
        }
        int p = -1;
        rep(i,a.size()){
            if(a[i]==bx){
                p = i;
                break;
            }
        }
        rep(i,n){
            if(i)cout<<" ";
            if(i==p)cout<<1;
            else cout<<i+1;
        }
        cout<<endl;

        rep(i,n){
            if(i)cout<<" ";
            if(i==p)cout<<2;
            else cout<<i+1;
        }
        cout<<endl;
}
}


### 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;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

int main(){
    int n;
    cin>>n;
    
    vector<int> a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    
    set<int> st;
    rep(i,b.size())st.insert(b[i]);
    
    if(st.size()==n){
        cout<<"Yes"<<endl;
        return 0;
    }else{
        cout<<"No"<<endl;
        int bx = -1;
        for(int i=1;i<=n;i++){
            if(st.count(i)==0){
                bx = i;
            }
        }
        int p = -1;
        rep(i,a.size()){
            if(a[i]==bx){
                p = i;
                break;
            }
        }
        rep(i,n){
            if(i)cout<<" ";
            if(i==p)cout<<1;
            else cout<<i+1;
        }
        cout<<endl;

        rep(i,n){
            if(i)cout<<" ";
            if(i==p)cout<<2;
            else cout<<i+1;
        }
        cout<<endl;
}
}


```