fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val dn = readLine()!!.split(" ").map(String::toInt).groupBy { it }.mapValues { it.value.size }

    val m = readLine()!!.toInt()
    val tn = readLine()!!.split(" ").map(String::toInt).groupBy { it }.mapValues { it.value.size }

    var flg = true
    for ((k, v) in tn) {
        flg = flg && dn.getOrElse(k, { 0 }) >= v
    }
    if (flg) {
        "YES"
    } else {
        "NO"
    }.let(::println)
}