n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
at = a.tally
bt = b.tally
ok = true
n.times do |i|
  ac = at[i + 1] || 0
  bc = bt[i + 1] || 0
#  puts "#{ac} #{bc}"
  ok = false if ac + bc > n
end
puts ok ? "Yes" : "No"
if ok
  ans = []
  bk = bt.keys
  i = 0
  at.each do |k, v|
    x = bk[i]
    v.times do
      while x == k || (bt[x] || 0) == 0 do
        i += 1
        i = 0 if i >= bk.length
        x = bk[i]
      end
      ans.push(x)
      bt[x] -= 1
    end
  end
  puts ans.join(" ")
end
