#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int N;
int A[200001];
int B[200001];
int cA[200001]={};
int cB[200001]={};
int ans[200001];

int main(){
 scanf("%d",&N);
 rep(i,N){ scanf("%d",&A[i]); cA[A[i]]++; A[i]--; }
 rep(i,N){ scanf("%d",&B[i]); cB[B[i]]++; B[i]--; }
 A[N] = B[N] = 1000000000;

 rep(i,N){ if(cA[i+1]+cB[i+1]>N){ printf("No\n"); return 0; } }
 rep(i,N){ cA[i+1]+=cA[i]; cB[i+1]+=cB[i]; }

 int d = 0;
 rep(i,N) d = max(d,cA[i+1]-cB[i]);

 printf("Yes\n");
 rep(i,N){
  if(i) printf(" ");
  printf("%d",B[(i+N-d)%N]+1);
 } printf("\n");

 return 0;
}


