n = gets.to_i
nums_a = gets.split.map(&:to_i)
nums_b = gets.split.map(&:to_i)
280.times do |i|
  nums_b_rotated = nums_b.rotate(i * Random.rand(3000))
  nums_b_rotated.reverse! if i > 270
  judge = true
  n.times do |j|
    if nums_a[j] == nums_b_rotated[j]
      judge = false
      break
    end
  end
  if judge
    puts "Yes"
    puts nums_b_rotated.join(" ")
    exit
  end
end
puts "No"
