import qualified Data.Map as M
import qualified Data.ByteString.Char8 as B

main = do
  B.getLine
  d <- mkdict . B.words <$> B.getLine
  B.getLine
  t <- B.words <$> B.getLine
  B.putStr $ solve d t
 
mkdict [] = M.empty
mkdict (x:xs) = M.insertWith f x 1 d
  where 
    f n o = succ o
    d = mkdict xs
 
solve d [] = B.pack "YES"
solve d (x:xs)
  | M.findWithDefault 0 x d == 0 = B.pack "NO"
  | otherwise = solve d' xs
  where d' = M.adjust pred x d