split :: Char -> String -> [String] split ch str = (words . map (\c -> if c == ch then ' ' else c)) str main = do a <- getLine >>= return . map (read::String->Int) . split '.' b <- getLine >>= return . map (read::String->Int) . split '.' putStrLn $ if a > b then "YES" else "NO"