#include<algorithm>
#include<iostream>
#include<set>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

int main(){
  int n;
  cin>>n;
  vi a(n),b(n);
  set<int> s,im;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  rep(i,n)s.insert(a[i]);
  rep(i,n)im.insert(b[i]);
  if((int)im.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  int tmp=-1;
  for(int e:s){
    if(im.count(e)==0)tmp=e;
  }
  vi c(n,tmp),d(n,tmp);
  rep(i,n){
    if(a[i]==tmp){
      c[i]=a[0];
      d[i]=a[1];
    }
  }
  cout<<"No"<<endl;
  rep(i,n){
    cout<<c[i]<<(i==n-1?"\n":" ");
  }
  rep(i,n){
    cout<<d[i]<<(i==n-1?"\n":" ");
  }
}


### 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<algorithm>
#include<iostream>
#include<set>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

int main(){
  int n;
  cin>>n;
  vi a(n),b(n);
  set<int> s,im;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  rep(i,n)s.insert(a[i]);
  rep(i,n)im.insert(b[i]);
  if((int)im.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  int tmp=-1;
  for(int e:s){
    if(im.count(e)==0)tmp=e;
  }
  vi c(n,tmp),d(n,tmp);
  rep(i,n){
    if(a[i]==tmp){
      c[i]=a[0];
      d[i]=a[1];
    }
  }
  cout<<"No"<<endl;
  rep(i,n){
    cout<<c[i]<<(i==n-1?"\n":" ");
  }
  rep(i,n){
    cout<<d[i]<<(i==n-1?"\n":" ");
  }
}


```