import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)
import Data.List
import Data.Array.IO

main = do
  n <- readLn :: IO Int
  a <- sort <$> getIntListBC
  b <- sort <$> getIntListBC
  if solve a b
    then putStrLn "Yes"
    else putStrLn "No"

solve :: [Int] -> [Int] -> Bool
solve []     []     = True
solve (a:as) (b:bs) = if a <= b
                        then solve as bs
                        else False

bsToInt :: BC.ByteString -> Int
bsToInt = fst . fromJust . BC.readInt

getIntListBC :: IO [Int]
getIntListBC = map bsToInt . BC.words <$> BC.getLine
