main :: IO ()
main = do
  s <- getLine
  t <- getLine
  putStrLn $ if f s t then "Yes" else "No"
  
f :: String -> String -> Bool
f "" "" = False
f _ "" = False
f "" _ = True
f s t
  | ms < mt = True
  | ms == mt = f (filter (/=ms) s) (filter (/=mt) t)
  | otherwise = False
    where
      ms = minimum s
      mt = minimum t
