N = gets.to_i
As, Bs = readlines.map{_1.split.map(&:to_i)}

ta, tb = As.tally, Bs.tally
(puts 'No'; exit) if ta.merge(tb){_2 + _3}.values.max > N
puts 'Yes'
ta.default = 0; tb.default = 0
cs, ds = [ta[0]], [tb[0]]
(1 .. N).each do |i|
  cs[i] = cs[i - 1] + ta[i]
  ds[i] = ds[i - 1] + tb[i]
end
of = cs[1 ..].zip(ds[.. -2]).map{_1 - _2}.max % N
puts Bs.cycle(2).drop(N - of).take(N).join(' ')