import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as VU
import qualified Data.Map as MP
import Data.Char

type Probs = MP.Map Int Int

step mp k = MP.insertWith (+) k 1 mp

solve :: Probs -> Probs -> String
solve mpd mpt 
  | solve' = "YES"
  | otherwise = "NO"
  where
    solve' = MP.foldlWithKey step True mpt
    step acc kt vt =
      case MP.lookup kt mpd of
        Just vd -> acc && (vd >= vt)
        Nothing -> False

main = do
  n <- readLn :: IO Int
  ds <- VU.unfoldrN n (B.readInt . B.dropWhile isSpace) <$> B.getLine
  m <- readLn :: IO Int
  ts <- VU.unfoldrN m (B.readInt . B.dropWhile isSpace) <$> B.getLine
  let mpd = VU.foldl' step MP.empty ds
  let mpt = VU.foldl' step MP.empty ts
  putStrLn $ solve mpd mpt