import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val d = (1..n).map { sc.nextInt() }.sorted()
    val m = sc.nextInt()
    val t = (1..m).map { sc.nextInt() }.sorted()

    var di = 0
    var ti = 0
    while (ti < m && di < n) {
        when {
            d[di] == t[ti] -> {
                di++
                ti++
            }
            d[di] < t[ti] -> {
                di++
            }
            else -> {
                println("NO")
                return
            }
        }
    }

    println(if (ti == m) "YES" else "NO")
}