import java.lang.Math
import kotlin.comparisons.*

val MOD: Int = 1000000000 + 7
val MODL: Long = MOD.toLong()

fun main(args: Array<String>)
{
    val n = read().toInt()
    val d = read().split().toInt()
    val m = read().toInt()
    val t = read().split().toInt()

    val dm = mutableMapOf<Int, Int>()
    for (i in 0 until n) {
        if (d[i] in dm)
            dm.put(d[i], dm[d[i]]!! + 1)
        else dm.put(d[i], 1)
    }
    val tm = mutableMapOf<Int, Int>()
    for (i in 0 until m) {
        if (t[i] in tm) tm.put(t[i], tm[t[i]]!! + 1)
        else tm.put(t[i], 1)
    }

    var ans = true
    for (diff in tm.keys) {
        if (dm.containsKey(diff)) {
            if (dm[diff]!! >= tm[diff]!!) continue
            else {
                ans = false
                break
            }
        } else {
            ans = false
            break
        }
    }

    println(if (ans) "YES" else "NO")
}

fun read(): String = readLine()!!
fun CharSequence.split(): List<String> = this.split(" ")
fun Iterable<String>.toInt(): List<Int> = this.map{it.toInt()}
fun Iterable<String>.toLong(): List<Long> = this.map{it.toLong()}
