output_description: If it is possible to satisfy s' < t', print `Yes`; if it is not, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s
      t
attempt: #
  # abc082 b
  #
  import unittest
  from io import StringIO
  import sys
  
  
  def input():
      return sys.stdin.readline().rstrip()
  
  
  def resolve():
      s = list(input())
      t = list(input())
  
      flag = False
      s = sorted(s, reverse=True)
      t = sorted(t, reverse=True)
      for i in range(min(len(s), len(t)):
          if s[i] < t[i]:
              flag = True
              break
          elif s[i] == t[i] and len(s) < len(t):
              flag = True
              break
  
      if flag == True:
          print("Yes")
      else:
          print("No")
  
  
  class TestClass(unittest.TestCase):
      def assertIO(self, input, output):
          stdout, stdin = sys.stdout, sys.stdin
          sys.stdout, sys.stdin = StringIO(), StringIO(input)
          resolve()
          sys.stdout.seek(0)
          out = sys.stdout.read()[:-1]
          sys.stdout, sys.stdin = stdout, stdin
          self.assertEqual(out, output)
  
      def test_入力例_1(self):
          input = """yx
  axy"""
          output = """Yes"""
          self.assertIO(input, output)
  
      def test_入力例_2(self):
          input = """ratcode
  atlas"""
          output = """Yes"""
          self.assertIO(input, output)
  
      def test_入力例_3(self):
          input = """cd
  abc"""
          output = """No"""
          self.assertIO(input, output)
  
      def test_入力例_4(self):
          input = """w
  ww"""
          output = """Yes"""
          self.assertIO(input, output)
  
      def test_入力例_5(self):
          input = """zzz
  zzz"""
          output = """No"""
          self.assertIO(input, output)
  
  
  if __name__ == "__main__":
      #unittest.main()
      resolve()
  
problem_description: Statement
  
  You are given strings s and t, consisting of lowercase English letters. You
  will create a string s' by freely rearranging the characters in s. You will
  also create a string t' by freely rearranging the characters in t. Determine
  whether it is possible to satisfy s' < t' for the lexicographic order.
samples: [{"input": "yx\n    axy", "output": "Yes\n    \n\nWe can, for example, rearrange `yx` into `xy` and `axy` into `yxa`. Then, `xy`\n< `yxa`.\n\n* * *"}, {"input": "ratcode\n    atlas", "output": "Yes\n    \n\nWe can, for example, rearrange `ratcode` into `acdeort` and `atlas` into\n`tslaa`. Then, `acdeort` < `tslaa`.\n\n* * *"}, {"input": "cd\n    abc", "output": "No\n    \n\nNo matter how we rearrange `cd` and `abc`, we cannot achieve our objective.\n\n* * *"}, {"input": "w\n    ww", "output": "Yes\n    \n\n* * *"}, {"input": "zzz\n    zzz", "output": "No"}]