tr '.' = ' ' tr c = c version = sum . zipWith (*) [1000000, 1000, 1] . map read . words . map tr main = do a <- getLine b <- getLine putStrLn $ if version a < version b then "NO" else "YES"