import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val ds =Seq.fill(n)(sc.nextInt)
  val m = sc.nextInt
  val ts =Seq.fill(m)(sc.nextInt)

  val dMap = ds.zipWithIndex.groupBy(_._1)
  val tMap = ts.zipWithIndex.groupBy(_._1)

  val res =
    tMap.keys.forall{ tKey =>
      val dVal = dMap.getOrElse(tKey, Seq.empty)
      dVal.size >= tMap(tKey).size
    }

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