#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int main(void)
{
  int n;
  cin >> n;
  vector<int> a(n),b(n);
  REP(i,n) cin >> a[i];
  REP(i,n) cin >> b[i];
  set<int> s(b.begin(), b.end());
  REP(i,n) if(s.find(i+1) == s.end()) {
    cout << "No" << endl;
    REP(j,n) {
      if(j) cout << ' ';
      cout << ((a[j]==i+1) ? 2 : 1);
    }
    cout << endl;
    REP(j,n) {
      if(j) cout << ' ';
      cout << 1;
    }
    cout << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}


### Prompt

Develop a solution in CPP 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>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int main(void)
{
  int n;
  cin >> n;
  vector<int> a(n),b(n);
  REP(i,n) cin >> a[i];
  REP(i,n) cin >> b[i];
  set<int> s(b.begin(), b.end());
  REP(i,n) if(s.find(i+1) == s.end()) {
    cout << "No" << endl;
    REP(j,n) {
      if(j) cout << ' ';
      cout << ((a[j]==i+1) ? 2 : 1);
    }
    cout << endl;
    REP(j,n) {
      if(j) cout << ' ';
      cout << 1;
    }
    cout << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}


```