import java.io.BufferedReader
import java.io.InputStreamReader
import java.util.*
import kotlin.math.min

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val n = jin.readLine().toInt()
    val freqA = IntArray(n + 1)
    val freqB = IntArray(n + 1)
    var tokenizer = StringTokenizer(jin.readLine())
    for (j in 1..n) {
        freqA[tokenizer.nextToken().toInt()]++
    }
    tokenizer = StringTokenizer(jin.readLine())
    for (j in 1..n) {
        freqB[tokenizer.nextToken().toInt()]++
    }
    val xs = (1..n).sortedByDescending { freqA[it] + freqB[it] }
    if (freqA[xs[0]] + freqB[xs[0]] > n) {
        println("No")
    } else {
        val startA = mutableListOf<Int>()
        val startB = mutableListOf<Int>()
        val endA = mutableListOf<Int>()
        val endB = mutableListOf<Int>()
        for (x in xs) {
            if (startA.size + endB.size < n && startA.size + endB.size + freqA[x] + freqB[x] > n) {
                val k = startA.size + endB.size + freqA[x] + freqB[x] - n
                val r = minOf(k, freqA[x], endB.size)
                freqA[x] -= r
                for (j in 1..r) {
                    endA.add(x)
                }
                freqB[x] -= k - r
                for (j in 1..k - r) {
                    startB.add(x)
                }
            }
            for (j in 1..freqA[x]) {
                startA.add(x)
            }
            for (j in 1..freqB[x]) {
                endB.add(x)
            }
        }
        val allA = startA + endA.reversed()
        val allB = startB + endB.reversed()
        println("Yes")
        println((0 until n).sortedBy { allA[it] }.map { allB[it] }.joinToString(" "))
    }
}