#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n),b(n);
  for(Int i=0;i<n;i++) cin>>a[i];
  for(Int i=0;i<n;i++) cin>>b[i];

  vector<Int> r(n+1);
  for(Int i=0;i<n;i++) r[a[i]]=i;

  set<Int> s;
  for(Int i=0;i<n;i++) s.emplace(b[i]);
  if((Int)s.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  
  Int p=1;
  while(s.count(p)) p++;

  cout<<"No"<<endl;
  
  for(Int i=0;i<n;i++){
    if(i) cout<<" ";
    if(i==r[p]) cout<<1;
    else cout<<i+1;
  }
  cout<<endl;
  
  for(Int i=0;i<n;i++){
    if(i) cout<<" ";
    if(i==r[p]) cout<<2;
    else cout<<i+1;
  }
  cout<<endl;
  
  return 0;
}


### Prompt

Generate 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<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n),b(n);
  for(Int i=0;i<n;i++) cin>>a[i];
  for(Int i=0;i<n;i++) cin>>b[i];

  vector<Int> r(n+1);
  for(Int i=0;i<n;i++) r[a[i]]=i;

  set<Int> s;
  for(Int i=0;i<n;i++) s.emplace(b[i]);
  if((Int)s.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  
  Int p=1;
  while(s.count(p)) p++;

  cout<<"No"<<endl;
  
  for(Int i=0;i<n;i++){
    if(i) cout<<" ";
    if(i==r[p]) cout<<1;
    else cout<<i+1;
  }
  cout<<endl;
  
  for(Int i=0;i<n;i++){
    if(i) cout<<" ";
    if(i==r[p]) cout<<2;
    else cout<<i+1;
  }
  cout<<endl;
  
  return 0;
}


```