# frozen_string_literal: true

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

if !satisfy
  puts 'No'
else
  puts 'Yes'
  cor=nil
  an.zip(bn).each do |arr|
    ai = arr[0]
    bi=arr[1]
    if ai==bi
      cor=ai
      break
    end
  end
  if(cor.nil?)
    puts bn.join(' ')
  else
    off_a = n - an.reverse.index(cor)
    off_b = bn.index(cor)
    offset = off_a - off_b
    cn = (0...n).map{|i| bn[(i - offset)%n]}
    puts cn.join(' ')
  end

end
