readLine()!
var D = [Int: Int]()
readLine()!.characters.split(" ").map({Int(String($0))!}).forEach {
  D[$0] = (D[$0] ?? 0) + 1
}
readLine()!
var ans = "YES"
readLine()!.characters.split(" ").map({Int(String($0))!}).forEach {
  if --(D[$0] ?? 0) < 0 {
    ans = "NO"
  }
}
print(ans)