#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <array>
#include <bitset>
#include <assert.h>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    int n;
    cin >> n;
    
    VI a(n), b(n);
    REP(i,n) a[i] = in(), a[i]--;
    REP(i,n) b[i] = in(), b[i]--;

    VI p(n);

    set<int> st;
    REP(i,n) st.insert(i);

    REP(i,n){
        p[a[i]] = b[i];
        st.erase(b[i]);
    }

    if (st.empty()){
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;

    REP(i,n){
        if (i > 0) cout << " ";
        cout << 1;
    }
    cout << endl;
    REP(i,n){
        if (i > 0) cout << " ";
        if (st.count(a[i])) cout << 2;
        else cout << 1;
    }
    cout << endl;

    return 0;
}

### Prompt

Generate 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 <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <array>
#include <bitset>
#include <assert.h>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    int n;
    cin >> n;
    
    VI a(n), b(n);
    REP(i,n) a[i] = in(), a[i]--;
    REP(i,n) b[i] = in(), b[i]--;

    VI p(n);

    set<int> st;
    REP(i,n) st.insert(i);

    REP(i,n){
        p[a[i]] = b[i];
        st.erase(b[i]);
    }

    if (st.empty()){
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;

    REP(i,n){
        if (i > 0) cout << " ";
        cout << 1;
    }
    cout << endl;
    REP(i,n){
        if (i > 0) cout << " ";
        if (st.count(a[i])) cout << 2;
        else cout << 1;
    }
    cout << endl;

    return 0;
}

```