# frozen_string_literal: true

def ina
  gets.chomp.split(' ').map(&:to_i)
end
n = gets.to_i
an = ina
bn = ina
buckets = Array.new(n, 0)
sa = Array.new(n+1, 0)
sb = Array.new(n+1, 0)
an.each do |ai|
  buckets[ai - 1] += 1
  sa[ai]+=1
end
bn.each do |bi|
  buckets[bi - 1] += 1
  sb[bi]+=1
end
satisfy = buckets.max <= n

if !satisfy
  puts 'No'
else
  puts 'Yes'
  (1..n).each do |i|
    sa[i]+=sa[i-1]
    sb[i]+=sb[i-1]
  end
  off = sa[1..-1].zip(sb[0..-2]).map{|arr| arr[0]-arr[1]}.max
  res = (0...n).map{|i| bn[(i-off)%n]}
  puts res.join(' ')
end
