fun longList() = readLine()?.split(" ")?.map(String::toLong) ?: TODO()
fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val d = longList()
    val m = readLine()?.toInt() ?: return
    val t = longList()

    val map = hashMapOf<Long, Int>()
    d.forEach { i ->
        map[i] = map[i]?.let {
            it + 1
        } ?: 1
    }
    t.forEach { i ->
        map[i]?.let {
            if (it == 0) {
                println("NO")
                return
            }
            map[i] = it - 1
        } ?: run {
            println("NO")
            return
        }
    }
    println("YES")
}
