module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import qualified Data.Vector.Unboxed as V

solve :: [Bool] -> Int -> Int -> String
solve [] ls lt
  | lt > ls = "Yes"
  | otherwise = "No"
solve (b:bs) ls lt
  | b = "Yes"
  | otherwise = solve bs ls lt

main :: IO ()
main = do
  s <- sort <$> getLine
  t <- sortOn Down <$> getLine
  putStrLn $ solve (zipWith (<=) s t) (length s) (length t)
