import java.util.*

fun main(args: Array<String>) {
    codefestival2017qualbb()
}

fun codefestival2017qualbb() {
    val n = readLine()!!.toInt()
    val dList = readLine()!!.split(' ').map { it.toLong() }
    val m = readLine()!!.toInt()
    val tList = readLine()!!.split(' ').map { it.toLong() }

    val dQueue = PriorityQueue(dList)
    val tQueue = PriorityQueue(tList)
    while (tQueue.isNotEmpty()) {
        val t = tQueue.poll()
        while (true) {
            if (dQueue.isEmpty()) return println("NO")
            if (t == dQueue.poll()) break
        }
    }

    val answer = if (tQueue.isEmpty()) "YES" else "NO"

    println(answer)
}
