import Data.List
f ::[Int]->[Int]->Bool
f [] []=True
f _ []=False
f [] _=False
f (a:as) (b:bs)
    |a<=b =f as bs
    |otherwise =f (a:as) bs

main = do
       e<-getLine
       a<-getLine
       b<-getLine
       let as=sort $ map read (words a)::[Int]
           bs=sort $ map read (words b)::[Int]
       putStrLn $ if f as bs then "Yes" else "No"