import Data.List

subsolver::[Int]->[Int]->Bool
subsolver _ [] = True
subsolver (x:xs) (y:ys) = if x == y then subsolver xs ys else subsolver xs (y:ys)

solver::[Int]->[Int]->Bool
solver xs ys = subsolver (sort xs) (sort ys)

main::IO()
main=do
  _<-getLine
  prop<-getLine
  let p = map read (words prop)
  _<-getLine
  need<-getLine
  let q = map read (words need)
  putStr (if (solver p q) then "YES\n" else "NO\n")
