import Data.List.Split main :: IO () main = interact $ solve . map (splitOn ".") . words solve :: [[String]] -> String solve [a, b] = if head a < head b then "NO" else if (head $ drop 1 a) < (head $ drop 1 b) then "NO" else if (head $ drop 2 a) < (head $ drop 2 b) then "NO" else "YES"