main::IO() main = do let f1 = map (\x->read x ::Int) . words . map (\x->if x=='.' then ' ' else x) r<-fmap f1 getLine t<-fmap f1 getLine putStrLn $ if t `compare` r ==GT then "NO" else "YES"