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

int N;
vector< pair<int, int> > ab;
vector<int> exist(N, false);

void solve(){
  vector<int> g(N), h(N);
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    g[v] = v;
    h[v] = v;

    if(exist[v] == false){
      h[v] = (v+1)%N;
    }
  }
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    if(i != 0) cout << " ";
    cout << g[v]+1;
  }
  cout << endl;
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    if(i != 0) cout << " ";
    cout << h[v]+1;
  }
  cout << endl;
}

int main(void){
  cin >> N;
  ab = vector< pair<int, int> >(N);
  for(int i = 0; i < N; i++){
    cin >> ab[i].first;
    ab[i].first--;
  }
  for(int i = 0; i < N; i++){
    cin >> ab[i].second;
    ab[i].second--;
  }

  exist = vector<int>(N, false);

  bool flg = false;
  for(int i = 0; i < N; i++){
    int b = ab[i].second;
    if(exist[b] == true){
      flg = true;
    }else{
      exist[b] = true;
    }
  }
  if(flg == false){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
    solve();
  }
  return 0;
}


### 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;

int N;
vector< pair<int, int> > ab;
vector<int> exist(N, false);

void solve(){
  vector<int> g(N), h(N);
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    g[v] = v;
    h[v] = v;

    if(exist[v] == false){
      h[v] = (v+1)%N;
    }
  }
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    if(i != 0) cout << " ";
    cout << g[v]+1;
  }
  cout << endl;
  for(int i = 0; i < N; i++){
    int v = ab[i].first;
    if(i != 0) cout << " ";
    cout << h[v]+1;
  }
  cout << endl;
}

int main(void){
  cin >> N;
  ab = vector< pair<int, int> >(N);
  for(int i = 0; i < N; i++){
    cin >> ab[i].first;
    ab[i].first--;
  }
  for(int i = 0; i < N; i++){
    cin >> ab[i].second;
    ab[i].second--;
  }

  exist = vector<int>(N, false);

  bool flg = false;
  for(int i = 0; i < N; i++){
    int b = ab[i].second;
    if(exist[b] == true){
      flg = true;
    }else{
      exist[b] = true;
    }
  }
  if(flg == false){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
    solve();
  }
  return 0;
}


```