n = gets.to_i
a = gets.split.map &:to_i
b = gets.split.map &:to_i

c = a.tally
d = b.tally

e, f = c.max_by { |k, v| v }
g, h = d.max_by { |k, v| v }

if d[e] + f > n || c[g] + h > n
  puts "No"
else
  puts "Yes"
  i = 0
  while b.length > 1
    tmp = b.pop
    if tmp != a[i]
      print "#{tmp} "
      i += 1
    else
      b.unshift tmp
    end
  end
  puts b.pop
end