{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

import qualified Data.Map.Strict as Map

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	m1 <- readMap
	m2 <- readMap
	putStrLn $ which "YES" "NO" $ Map.isSubmapOfBy (<=) m2 m1

readMap :: IO ( Map.Map Int Int )
readMap = getLine >> getList >>= return . foldl f Map.empty

f m a
	| Map.lookup a m /= Nothing = Map.adjust succ a m
	| otherwise = Map.insert a 1 m
