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]
    putStrLn $ if all (\t -> count t ds < count t ts) $ nub ts
        then "NO"
        else "YES"

count x = length . filter (x==)