"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextssort(n,a){return a?cin.slice(cid,cid+=n).map(a=>+a).sort((a,b)=>b-a):cin.slice(cid,cid+=n).map(a=>+a).sort((a,b)=>a-b);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}
var streams=[];function print(s){streams.push(s);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));
if(streams.length)console.log(streams.join("\n"));

function main(){
  var n = next();
  var a = nexts(n);
  var b = nexts(n);
  b = b.concat(b);
  var c = xArray(0,n+1);
  var d = xArray(0,n+1);
  for(var i = 0; i < n; i++){
    c[a[i]]++;
  }
  for(var i = 0; i < n; i++){
    d[b[i]]++;
    if(c[b[i]]+d[b[i]] > n)return "No";
  }
  console.log("Yes");
  var x = [];
  for(var i = 1; i <= n; i++){
    c[i] += c[i-1];
    d[i] += d[i-1];
    if(c[i]-c[i-1] === 0 || d[i]-d[i-1] === 0)continue;
    c[i]--,d[i]--;
    var l = 0, r = c[i]-d[i-1]+1;
    if(!f([c[i-1],c[i]],[d[i-1],d[i]]))l = c[i-1]-d[i];
    if(l < 0)l += n;
    if(r < 0)r += n;
    x.push([l,r]);
    c[i]++,d[i]++;
  }
  x.sort((a,b)=>a[0]-b[0]);
  var y = 0;
  for(var i = 0; i < x.length; i++){
    var z = x[i];
    if(z[0] <= y && y < z[1])y = z[1];
  }
  y = n-y;
  return b.slice(y,y+n).join(" ");
}
function f(a,b){
  if(b[0] <= a[0] && a[0] <= b[1])return true;
  if(b[0] <= a[1] && a[1] <= b[1])return true;
  return false;
}