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: #!/user/bin/python
  # coding: UTF-8
  
  s = input()
  t = input()
  s_list = list(s)
  t_list = list(t)
  
  
  def a2n(alfabet):
      for i in range(len(alfabet)):
          if alfabet[i] == "a":
              alfabet[i] = 1
          elif alfabet[i] == "b":
              alfabet[i] = 2
          elif alfabet[i] == "c":
              alfabet[i] = 3
          elif alfabet[i] == "d":
              alfabet[i] = 4
          elif alfabet[i] == "e":
              alfabet[i] = 5
          elif alfabet[i] == "f":
              alfabet[i] = 6
          elif alfabet[i] == "g":
              alfabet[i] = 7
          elif alfabet[i] == "h":
              alfabet[i] = 8
          elif alfabet[i] == "i":
              alfabet[i] = 9
          elif alfabet[i] == "j":
              alfabet[i] = 10
          elif alfabet[i] == "k":
              alfabet[i] = 11
          elif alfabet[i] == "l":
              alfabet[i] = 12
          elif alfabet[i] == "m":
              alfabet[i] = 13
          elif alfabet[i] == "n":
              alfabet[i] = 14
          elif alfabet[i] == "o":
              alfabet[i] = 15
          elif alfabet[i] == "p":
              alfabet[i] = 16
          elif alfabet[i] == "q":
              alfabet[i] = 17
          elif alfabet[i] == "r":
              alfabet[i] = 18
          elif alfabet[i] == "s":
              alfabet[i] = 19
          elif alfabet[i] == "t":
              alfabet[i] = 20
          elif alfabet[i] == "u":
              alfabet[i] = 21
          elif alfabet[i] == "v":
              alfabet[i] = 22
          elif alfabet[i] == "w":
              alfabet[i] = 23
          elif alfabet[i] == "x":
              alfabet[i] = 24
          elif alfabet[i] == "y":
              alfabet[i] = 25
          elif alfabet[i] == "z":
              alfabet[i] = 26
      return alfabet
  
  
  ns = a2n(s_list)
  ns.sort()
  nt = a2n(t_list)
  nt.sort()
  nt.reverse()
  
  for i in range(len(ns)):
      if ns[i] == nt[i]:
          ans = "next"
      elif ns[i] < nt[i]:
          ans = "Yes"
          break
      elif ns[i] > nt[i]:
          ans = "No"
          break
  if ans == "next":
      if len(ns) < len(nt):
          ans = "Yes"
      else:
          ans = "No"
  
  print(ans)
  
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"}]