n=gets.to_i
l=[0]*200001
a=gets.split.map(&:to_i)
b=gets.split.map(&:to_i)
a.each do |c|
  l[c]+=1
end
b.each do |c|
  l[c]+=1
end
lm=l.max
if lm>n
  puts "No"
  exit
else
  puts "Yes"
end
i=l.index(lm)
if b.index(i)==0
  d=b
else
  d=b[b.index(i)..(n-1)]+b[0..b.index(i)-1]
end
if a.reverse.index(i)==0
  e=d
else
  e=d[a.reverse.index(i)..n-1]+d[0..a.reverse.index(i)-1]
end
puts e.join(" ")
