#include<bits/stdc++.h>
using namespace std;

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n;cin>>n;
  vector<int> a(n);
  vector<int> b(n);
  int i;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  rep(i,n)
  {
    a[i]--;
    b[i]--;
  }
  //vector<int> pos(n,0);
  //rep(i,n)pos[a[i]]=i;
  vector<int> counts(n,0);
  rep(i,n)
  {
    counts[b[i]]++;
  }
  bool ok=true;
  vector<bool> bfind(n,false);
  rep(i,n)
  {
    if(counts[i]!=1)ok=false;
    bfind[b[i]]=true;
  }
  if(ok)cout<<"Yes"<<endl;
  else
  {
    cout<<"No"<<endl;
    rep(i,n)
    {
      if(i!=0)cout<<' ';
      cout<<1;
    }
    cout<<endl;
    int count=1;
    rep(i,n)
    {
      if(i!=0)cout<<' ';
      if(!bfind[a[i]])
      {
        cout<<count+1;
        count++;
      }
      else cout<<1;

    }
    cout<<endl;
  }
}


### Prompt

Create a solution in Cpp for 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;

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n;cin>>n;
  vector<int> a(n);
  vector<int> b(n);
  int i;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  rep(i,n)
  {
    a[i]--;
    b[i]--;
  }
  //vector<int> pos(n,0);
  //rep(i,n)pos[a[i]]=i;
  vector<int> counts(n,0);
  rep(i,n)
  {
    counts[b[i]]++;
  }
  bool ok=true;
  vector<bool> bfind(n,false);
  rep(i,n)
  {
    if(counts[i]!=1)ok=false;
    bfind[b[i]]=true;
  }
  if(ok)cout<<"Yes"<<endl;
  else
  {
    cout<<"No"<<endl;
    rep(i,n)
    {
      if(i!=0)cout<<' ';
      cout<<1;
    }
    cout<<endl;
    int count=1;
    rep(i,n)
    {
      if(i!=0)cout<<' ';
      if(!bfind[a[i]])
      {
        cout<<count+1;
        count++;
      }
      else cout<<1;

    }
    cout<<endl;
  }
}


```