tr '.' = ' ' tr c = c version = foldr (\a b -> 1000 * a + b) 0 . map read . words . map tr main = do a <- getLine b <- getLine putStrLn $ if version a < version b then "NO" else "YES"