import qualified Data.Map.Strict as Map


solver::Map.Map Int Int -> [Int] -> Bool
solver m [] = True
solver m (y:ys) = if Map.member y m then
                        case (Map.!) m y of
                          0 -> False
                          1 -> solver (Map.delete y m) ys
                          n -> solver (Map.adjust (\ l -> l-1) y m) ys
                                else False

createmap::[Int]->Map.Map Int Int
createmap [] = Map.empty
createmap (x:xs) = let rest = createmap xs in
                    if Map.member x rest then Map.adjust (\ l -> l+1 ) x rest
                                         else Map.insert x 1 rest

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