n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
b = gets.chomp.split(' ').map(&:to_i)
ca = a.tally
cb = b.tally

if (1..n).any? { |i| ca.fetch(i, 0) + cb.fetch(i, 0) > n }
  puts 'No'
else
  puts 'Yes'

  ans = Array.new(n)
  
  (1..n).each do |i|
    next unless ca[i] && cb[i]

    idx = a.bsearch_index { |x| x >= i }

    k = i == n ? 1 : i + 1
    (0...ca[i]).each do |j|
      loop do
        if k == i || !cb[k]
          k += 1
          k = 1 if k > n
        end
        break if ca[k]
      end

      ans[idx + j] = k
      cb[k] -= 1
      cb.delete(k) if cb[k] == 0
    end
  end

  (0...n).each do |j|
    next if ans[j]
    k = cb.keys[0]
    ans[j] = k
    cb[k] -= 1
    cb.delete(k) if cb[k] == 0
  end

  puts ans.join(' ')
end
