#include<bits/stdc++.h>

using namespace std;


int main() {
  int N, A[100000], B[100000];

  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];
  for(int i = 0; i < N; i++) cin >> B[i];

  set< int > C(B, B + N);
  if(C.size() == N) {
    cout << "Yes" << endl;
    return (0);
  } else {
    vector< int > rev(N + 1);
    for(int i = 0; i < N; i++) rev[A[i]] = i;
    int p = 1;
    while(C.count(p)) p++;

    cout << "No" << endl;
    for(int i = 0; i < N; i++) {
      if(i) cout << " ";
      if(i == rev[p]) cout << 1;
      else cout << i + 1;
    }
    cout << endl;
    for(int i = 0; i < N; i++) {
      if(i) cout << " ";
      if(i == rev[p]) cout << 2;
      else cout << i + 1;
    }
    cout << endl;
  }
}

### Prompt

Please provide a Cpp coded solution 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<bits/stdc++.h>

using namespace std;


int main() {
  int N, A[100000], B[100000];

  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];
  for(int i = 0; i < N; i++) cin >> B[i];

  set< int > C(B, B + N);
  if(C.size() == N) {
    cout << "Yes" << endl;
    return (0);
  } else {
    vector< int > rev(N + 1);
    for(int i = 0; i < N; i++) rev[A[i]] = i;
    int p = 1;
    while(C.count(p)) p++;

    cout << "No" << endl;
    for(int i = 0; i < N; i++) {
      if(i) cout << " ";
      if(i == rev[p]) cout << 1;
      else cout << i + 1;
    }
    cout << endl;
    for(int i = 0; i < N; i++) {
      if(i) cout << " ";
      if(i == rev[p]) cout << 2;
      else cout << i + 1;
    }
    cout << endl;
  }
}

```