import java.util.*

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


  val dmap = mutableMapOf<Int, Int>()
  for (di in d) {
    val tmp = dmap.getOrElse(di) { 0 }
    dmap.put(di, tmp+1)
  }
  val tmap = mutableMapOf<Int, Int>()
  for (ti in t) {
    val tmp = tmap.getOrElse(ti) { 0 }
    tmap.put(ti, tmp+1)
  }

  for (key in tmap.keys) {
    val di = dmap.getOrElse(key) { 0 }
    val ti = tmap.getOrElse(key) { 0 }

    if (di < ti) {
      println("NO")
      return
    }
  }
  println("YES")

}