N = gets.to_i
A = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

C = Array.new(N + 1, 0)
counterA = A.tally
counterA.default = 0
cnt = 0
1.upto(N) do |num|
  c = counterA[num]
  cnt += c
  C[num] += cnt
end

D = Array.new(N + 1, 0)
counterB = B.tally
counterB.default = 0
cnt = 0
max_d = 0
1.upto(N) do |num|
  c = counterB[num]
  if N < counterA[num] + c
    puts "No"
    exit
  end

  cnt += c
  D[num] += cnt
  diff = C[num] - D[num - 1]
  max_d = diff if max_d < diff
end

puts 'Yes'
puts B.rotate(-max_d).join(' ')
