// 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)
{
    long[long] dx;
    long[long] dy;
    foreach (a; A)
        dx[a] = dx.get(a, 0) + 1;
    foreach (a; B)
        dy[a] = dy.get(a, 0) + 1;
    foreach (key, value; dx)
    {
        if (N < value + dy.get(key, 0))
        {
            writeln("No");
            return;
        }
    }
    alias T = Tuple!(long, long);
    PQueue!(T, "a<b") Q;
    foreach (i; 1 .. N + 1)
    {
        if (i in dy)
            Q.insert(T(dy[i], -i));
    }
    auto ans = new long[](N);
    ans[] = -1;
    long ptr;
    while (!Q.empty)
    {
        auto t = Q.front;
        Q.removeFront();
        dprint(ptr, t, ans);
        long cnt;
        while (cnt < t[0])
        {
            if (A[ptr % N] != -t[1] && ans[ptr % N] == -1)
            {
                ans[ptr % N] = -t[1];
                cnt++;
            }
            ptr++;
        }
    }
    writeln("Yes");
    arywrite(ans);
}
