#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int 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> cnt(N);
  for(auto e : B)
    ++cnt[e-1];
  if(*min_element(cnt.begin(), cnt.end()) > 0){
    puts("Yes");
    return 0;
  }
  vector<int> C(N,2), D(N);
  for(int i = 0; i < N; ++i){
    D[i] = (cnt[A[i]-1] > 0) + 1;
  }
  puts("No");
  for(int i = 0; i < N; ++i)
    cout << C[i] << (i+1 < N ? " " : "\n");
  for(int i = 0; i < N; ++i)
    cout << D[i] << (i+1 < N ? " " : "\n");
}


### Prompt

Your challenge is to write 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 <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int 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> cnt(N);
  for(auto e : B)
    ++cnt[e-1];
  if(*min_element(cnt.begin(), cnt.end()) > 0){
    puts("Yes");
    return 0;
  }
  vector<int> C(N,2), D(N);
  for(int i = 0; i < N; ++i){
    D[i] = (cnt[A[i]-1] > 0) + 1;
  }
  puts("No");
  for(int i = 0; i < N; ++i)
    cout << C[i] << (i+1 < N ? " " : "\n");
  for(int i = 0; i < N; ++i)
    cout << D[i] << (i+1 < N ? " " : "\n");
}


```