#include <iostream>
#include <map>
#include <vector>

using namespace std;
int main(){
  int N;
  cin >> N;
  vector<bool> A(N,false), B(N,false);
  vector<int> a(N), b(N), ans(N);
  for(int i = 0; i < N; ++i){
    cin >> a[i];
  }
  for(int i = 0; i < N; ++i){
    cin >> b[i];
    B[b[i]-1] = true;
  }
  bool f = true;
  for(int i = 0; i < N; ++i){
    if(B[a[i] - 1]) ans[i] = a[i];
    else{
      ans[i] = (a[i])%N + 1;
      f = false;
    }
  }
  if(f){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
    for(int i = 0; i < N-1; ++i) cout << a[i] << " ";
    cout << a.back() << endl;
    for(int i = 0; i < N-1; ++i) cout << ans[i] << " ";
    cout << ans.back() << endl;
  }
  return 0;
}


### Prompt

In Cpp, your task is to solve 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 <iostream>
#include <map>
#include <vector>

using namespace std;
int main(){
  int N;
  cin >> N;
  vector<bool> A(N,false), B(N,false);
  vector<int> a(N), b(N), ans(N);
  for(int i = 0; i < N; ++i){
    cin >> a[i];
  }
  for(int i = 0; i < N; ++i){
    cin >> b[i];
    B[b[i]-1] = true;
  }
  bool f = true;
  for(int i = 0; i < N; ++i){
    if(B[a[i] - 1]) ans[i] = a[i];
    else{
      ans[i] = (a[i])%N + 1;
      f = false;
    }
  }
  if(f){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
    for(int i = 0; i < N-1; ++i) cout << a[i] << " ";
    cout << a.back() << endl;
    for(int i = 0; i < N-1; ++i) cout << ans[i] << " ";
    cout << ans.back() << endl;
  }
  return 0;
}


```