// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on
immutable string YES = "Yes";
immutable string NO = "No";
void main()
{
    auto input = stdin.byLine.map!split.joiner;

    long N;
    N = input.front.to!long;
    input.popFront;

    long[] A = new long[](cast(size_t)(N));
    foreach (i; 0 .. cast(size_t)(N))
    {
        A[i] = input.front.to!long;
        input.popFront;
    }

    long[] B = new long[](cast(size_t)(N));
    foreach (i; 0 .. cast(size_t)(N))
    {
        B[i] = input.front.to!long;
        input.popFront;
    }

    solve(N, A, B);
}

void solve(long N, long[] A, long[] B)
{
    auto cntA = new long[](N + 1);
    auto cntB = new long[](N + 1);

    foreach (a; A)
        cntA[a]++;
    foreach (b; B)
        cntB[b]++;
    foreach (i; 0 .. N + 1)
        if (N < cntA[i] + cntB[i])
        {
            writeln("No");
            return;
        }
    auto sumA = new long[](N + 2);
    auto sumB = new long[](N + 2);
    sumA[0 .. $ - 1] = cntA[];
    sumB[0 .. $ - 1] = cntB[];
    foreach (i; 0 .. N + 1)
    {
        sumA[i + 1] += sumA[i];
        sumB[i + 1] += sumB[i];
    }
    long diff;
    foreach (i; 1 .. N + 1)
    {
        diff = diff.max(sumA[i] - sumB[i - 1]);
    }
    dprint(diff);
    auto ans = B[$ - diff .. $] ~ B[0 .. $ - diff];
    writeln("Yes");
    arywrite(ans);
}
