require 'pp'

n = gets.to_i
a_n = gets.split.map(&:to_i)
b_n = gets.split.map(&:to_i)

x = a_n.tally
y = b_n.tally
keys = y.keys
sum = {}
x.each do |k, v|
    t = v + (y[k] || 0) 
    if t > n
        puts 'No'
        exit 0
    end

    sum[k] = t
end
puts "Yes"

num = -1
max = -1
x.each do |k, cnt|
    if cnt > max
        max = cnt
        num = k
    end
end

#pp num
#pp max
index = a_n.bsearch_index{|x| x >= num }
#pp index
index2 = b_n.bsearch_index{|x| x >= num } || 0
#pp index2

start = (index + max) % n

ans = Array.new(n, 0)
n.times do |i|
    ans[start] = b_n[index2]
    start = (start + 1) % n
    index2 = (index2 + 1) % n
end

puts ans.join(" ")
