import Data.Bool main = do a0 <- map read . words . map (\c -> if c=='.' then ' ' else c) <$> getLine :: IO [Int] a1 <- map read . words . map (\c -> if c=='.' then ' ' else c) <$> getLine putStrLn $ bool "NO" "YES" (a0>=a1)