#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n;
ll a[101010];
ll b[101010];
set<ll> st;
bool used[101010];

int main(){
  cin>>n;
  rep(i,n){
    cin>>a[i];
  }
  rep(i,n){
    cin>>b[i];
    st.insert(b[i]);
  }
  if(st.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  for(ll h : st){
    used[h]=true;
  }
  vector<P> res;
  repl(i,1,n+1){
    if(!used[i]){
      res.push_back(P(1,2));
    }else{
      res.push_back(P(1,1));
    }
  }
  cout<<"No"<<endl;
  cout<<res[a[0]-1].fi;
  repl(i,1,n){
    cout<<" "<<res[a[i]-1].fi;
  }
  cout<<endl;
  cout<<res[a[0]-1].se;
  repl(i,1,n){
    cout<<" "<<res[a[i]-1].se;
  }
  cout<<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>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n;
ll a[101010];
ll b[101010];
set<ll> st;
bool used[101010];

int main(){
  cin>>n;
  rep(i,n){
    cin>>a[i];
  }
  rep(i,n){
    cin>>b[i];
    st.insert(b[i]);
  }
  if(st.size()==n){
    cout<<"Yes"<<endl;
    return 0;
  }
  for(ll h : st){
    used[h]=true;
  }
  vector<P> res;
  repl(i,1,n+1){
    if(!used[i]){
      res.push_back(P(1,2));
    }else{
      res.push_back(P(1,1));
    }
  }
  cout<<"No"<<endl;
  cout<<res[a[0]-1].fi;
  repl(i,1,n){
    cout<<" "<<res[a[i]-1].fi;
  }
  cout<<endl;
  cout<<res[a[0]-1].se;
  repl(i,1,n){
    cout<<" "<<res[a[i]-1].se;
  }
  cout<<endl;
  return 0;
}


```