import Data.List
import Control.Monad

main = do
    n <- readLn :: IO Int
    ds <- map read . words <$> getLine :: IO [Int]
    m <- readLn :: IO Int
    ts <- map read . words <$> getLine :: IO [Int]
    let nts = nub ts
    let ids = intersect ds nts
    putStrLn $ if all (\t -> count t ids >= count t ts) nts
        then "YES"
        else "NO"
        where 

count x = length . filter (x==)
