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.

-----Notes-----
For a string a = a_1 a_2 ... a_N of length N and a string b = b_1 b_2 ... b_M of length M, we say a < b for the lexicographic order if either one of the following two conditions holds true:
 - N < M and a_1 = b_1, a_2 = b_2, ..., a_N = b_N.
 - There exists i (1 \leq i \leq N, M) such that a_1 = b_1, a_2 = b_2, ..., a_{i - 1} = b_{i - 1} and a_i < b_i. Here, letters are compared using alphabetical order.
For example, xy < xya and atcoder < atlas.

-----Constraints-----
 - The lengths of s and t are between 1 and 100 (inclusive).
 - s and t consists of lowercase English letters.

-----Input-----
Input is given from Standard Input in the following format:
s
t

-----Output-----
If it is possible to satisfy s' < t', print Yes; if it is not, print No.

-----Sample Input-----
yx
axy

-----Sample Output-----
Yes

We can, for example, rearrange yx into xy and axy into yxa. Then, xy < yxa.
[{"code": "import sys\n\ninput = sys.stdin.readline\ns = list(input().strip())\nt = list(input().strip())\nif sorted(s) < sorted(t, reverse=True):\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "s=list(input())\nt=list(input())\ns.sort()\nt.sort(reverse=True)\nif s<t:\n  print(\"Yes\")\nelse:\n  print(\"No\")\n  \n", "passed": true, "time": 0.26, "memory": 14272.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(), reverse=True)\ns = \"\".join(s)\nt = \"\".join(t)\n#print(s, t)\nif s<t:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.28, "memory": 14116.0, "status": "done"}, {"code": "s = sorted(list(input()))\nt = sorted(list(input()), reverse=True)\n\nif s < t:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.28, "memory": 14284.0, "status": "done"}, {"code": "from collections import defaultdict\n\ns = input()\nt = input()\n\nAL = \"abcdefghijklmnopqrstuvwxyz\"\nS = defaultdict(int)\nT = defaultdict(int)\n\nfor al in s:\n  S[al] += 1\n\nfor al in t:\n  T[al] += 1\n\nans_s = \"\"\nfor al in AL:\n  ans_s += al*S[al]\n\nans_t = \"\"\nfor al in reversed(list(AL)):\n  ans_t += al*T[al]\n\nif ans_s < ans_t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.27, "memory": 14092.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\nif s<t:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\nprint('Yes' if s < t else 'No')", "passed": true, "time": 0.18, "memory": 14068.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns.sort()\nt.sort(reverse = True)\n\ns1 = ''.join(s)\nt1 = ''.join(t)\n\nif s < t :\n    print(\"Yes\")\nelse :\n    print(\"No\")\n", "passed": true, "time": 0.16, "memory": 14132.0, "status": "done"}, {"code": "s = \"\".join(sorted(input()))\nt = \"\".join(sorted(input(), reverse=True))\nif s < t:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.23, "memory": 14272.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns = \"\".join(sorted(s))\nt = \"\".join(sorted(t)[::-1])\n\nprint(( \"Yes\" if s<t else \"No\"))\n", "passed": true, "time": 0.21, "memory": 14320.0, "status": "done"}, {"code": "s=sorted(input())\nt=sorted(input(),reverse=True)\nif s<t:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.16, "memory": 14200.0, "status": "done"}, {"code": "s = sorted(list(input()))\nt = reversed(sorted(list(input())))\nif \",\".join(s) < \",\".join(t):\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.17, "memory": 14148.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns = sorted(s)\nt = sorted(t, reverse=True)\n\n#print(s,t)\nflag = [0,0]\n\nif len(s) < len(t):\n    for i in range(len(s)):\n        if s[i]<t[i]:\n            print('Yes')\n            break\n        elif s[i] > t[i]:\n            print('No')\n            break\n        elif i == len(s)-1:\n            print('Yes')\nelif len(s) > len(t):\n    for i in range(len(t)):\n        if s[i]<t[i]:\n            print('Yes')\n            break\n        elif s[i] > t[i]:\n            print('No')\n            break\n        elif i == len(t)-1:\n            print('No')\nelif len(s) == len(t):\n    for i in range(len(s)):\n        if s[i]<t[i]:\n            print('Yes')\n            break\n        elif s[i] > t[i]:\n            print('No')\n            break\n        elif i == len(s)-1:\n            print('No')\n", "passed": true, "time": 1.73, "memory": 14344.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\ns = \"\".join(s)\nt = \"\".join(t)\nprint(\"Yes\" if s < t else \"No\")", "passed": true, "time": 0.16, "memory": 14408.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input())[::-1]\nprint((\"Yes\" if s<t else \"No\"))\n", "passed": true, "time": 0.27, "memory": 14044.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(),reverse = True)\nflag1 = True\nflag2 = False\nif len(s) < len(t):\n    for i in range(len(s)):\n        if s[i] != t[i]:\n            flag1 = False\n            break\nelse:\n    flag1 = False\nfor i in range(min(len(s), len(t))):\n    if s[i] < t[i]:\n        flag2 = True\n        break\n    elif s[i] > t[i]:\n        break\nif flag1 or flag2:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.15, "memory": 14268.0, "status": "done"}, {"code": "s = list(map(str, input().rstrip()))\nt = list(map(str, input().rstrip()))\n\ns.sort()\nt.sort(reverse=True)\n\ns = \"\".join(s)\nt = \"\".join(t)\n\nprint(\"Yes\" if s < t else \"No\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(), reverse=True)\nif s < t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "def main():\n    s = input()\n    t = input()\n    s_list = []\n    t_list = []\n    for i in range(len(s)):\n        s_list.append(s[i])\n    for i in range(len(t)):\n        t_list.append(t[i])\n    s_list.sort()\n    t_list.sort(reverse = True)\n    #print(s_list,t_list)\n    #if 'a'<'b':\n        #print ('Yes')\n    s_l = len(s_list)\n    t_l = len(t_list)\n    if s_l >= t_l:\n        ans = 'No'\n    else:\n        ans = 'Yes'\n\n    for i in range(min(s_l,t_l)):\n        if s_list[i] == t_list[i]:\n            continue\n        elif s_list[i] > t_list[i]:\n            return ('No')\n        else:\n            return('Yes')\n\n    return ans\n\nprint((main()))\n", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "s,t = [input() for i in range(2)]\n\ns_2 = sorted(s)\nt_2 = sorted(t,reverse=True)\n\nif s_2 < t_2:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.18, "memory": 14080.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns = sorted(s)\nt = sorted(t,reverse = True)\nif \"\".join(s) < \"\".join(t):\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "s=input()\nt=input()\ndata=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']\nS=[0]*len(s)\nT=[0]*len(t)\nfor i in range(len(s)):\n  S[i]=data.index(s[i])\nfor i in range(len(t)):\n  T[i]=data.index(t[i])\nS.sort()\nT.sort(reverse=True)\nif S<T:\n  print('Yes')\nelse:\n  print('No')", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "S = input()\nT = input()\n\nif sorted(S) < sorted(T,reverse=True) :\n  print(\"Yes\")\nelse :\n  print(\"No\")", "passed": true, "time": 0.19, "memory": 14052.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input())[::-1]\nif s < t:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "s = ''.join(sorted(list(input())))\nt = ''.join(sorted(list(input()))[::-1])\nprint('Yes' if s < t else 'No')", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "s = \"\".join(sorted(str(input())))\nt = \"\".join(sorted(str(input()), reverse=True))\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "#28 B - Two Anagrams AC\ns = list(input())\nt = list(input())\n\ns = sorted(s,reverse = False)\nt = sorted(t,reverse = True)\n\ns = ''.join(s)\nt = ''.join(t)\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "s,t=sorted(list(input())),sorted(list(input()),reverse=True)\nprint(\"Yes\" if s<t else \"No\")", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns = sorted(s)\nt = sorted(t)[::-1]\n\nanswer = \"Yes\"\nfor i in range(len(s)):\n  if i == len(t):\n    answer = \"No\"\n    break\n  s_c = s[i]\n  t_c = t[i]\n  if s_c < t_c:\n    break\n  elif s_c == t_c:\n    continue\n  else:\n    answer = \"No\"\n    break\n\nif s == t:\n  answer = \"No\"\n\nprint(answer)", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\ns = list(str(input()))\nt = list(str(input()))\n\ns.sort()\nt.sort(reverse=True)\n\ns = \"\".join(s)\nt = \"\".join(t)\n\nans = sorted([s, t])\n# print(ans)\n\nif ans[0] == t:\n    print(\"No\")\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "s = str(input())\nt = str(input())\n\n# \u6587\u5b57\u5217s\u3092\u30bd\u30fc\u30c8\uff08sorted\u3092\u3059\u308b\u3068\u914d\u5217\u578b\u306b\u306a\u308b\u306e\u3067join\u3057\u3066\u4e0a\u3052\u308b\u5fc5\u8981\u3042\u308a\uff09\nsort_s_list = sorted(s)\nsort_s = \"\".join(sort_s_list)\n\n# \u6587\u5b57\u5217t\u3092\u9006\u30bd\u30fc\u30c8\nt_list = list(t)\nt_list.sort(reverse = True)\nreverse_sort_t = \"\".join(t_list)\n\nif sort_s < reverse_sort_t:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14136.0, "status": "done"}, {"code": "#28 B - Two Anagrams\ns = list(input())\nt = list(input())\n\ns = sorted(s,reverse = False)\nt = sorted(t,reverse = True)\n\nresult = 'No'\nrang = min(len(s),len(t))\nfor i in range(rang):\n    if ord(s[i]) < ord(t[i]):\n        result = 'Yes'\n        break\nelse:\n    # \u6587\u5b57\u304c\u4e00\u7dd2\u3067 t \u306e\u65b9\u304c\u6587\u5b57\u6570\u304c\u591a\u3044\u3068\u304d\n    if (s[:rang] == t[:rang]) and len(s) < len(t):\n        result = 'Yes'\nprint(result)", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "s = sorted(str(input()))\nt = sorted(str(input()), reverse = True)\nprint(\"Yes\" if s < t else \"No\")", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "#n = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\ns = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\nif s < t:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "s = list(str(input()))\nt = list(str(input()))\n\nasc_s = sorted(s)\ndesc_t = sorted(t, reverse=True)\n\nprint(\"Yes\" if ''.join(asc_s) < ''.join(desc_t) else \"No\")", "passed": true, "time": 0.18, "memory": 14228.0, "status": "done"}, {"code": "s=\"\".join(sorted(str(input())))\nt=\"\".join(sorted(str(input()),reverse=True))\nif s<t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "s=list(input())\nt=list(input())\ns.sort()\nt.sort(reverse=True)\nif s<t:print('Yes')\nelse:print('No')", "passed": true, "time": 0.23, "memory": 14080.0, "status": "done"}, {"code": "a, b = [sorted(input()) for i in range(2)]\nprint(\"Yes\" if a < b[::-1] else \"No\")", "passed": true, "time": 0.14, "memory": 14052.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nss = sorted(s)\ntt = sorted(t, reverse=True)\n\n\ndef checker(s, t):\n    for sz in ss:\n        for tz in tt:\n            if sz > tz:\n                return 'No'\n            elif sz == tz:\n                continue\n            else:\n                return 'Yes'\n    if len(ss) < len(tt):\n        return 'Yes'\n    return 'No'\n\n\nprint((checker(ss, tt)))\n", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns_list = list(s)\nt_list = list(t)\n\ns_sorted = sorted(s_list)\nt_sorted = sorted(t_list, reverse=True)\n\ns_joined = ''.join(s_sorted) \nt_joined = ''.join(t_sorted) \n\nif s_joined < t_joined:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.15, "memory": 14236.0, "status": "done"}, {"code": "s = ''.join(sorted(input()))\nt = ''.join(reversed(sorted(input())))\n\nif s < t:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.22, "memory": 14064.0, "status": "done"}, {"code": "S = sorted(input())\nT = sorted(input(), reverse=True)\n\nif S < T:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.18, "memory": 14164.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nsys.setrecursionlimit(10**6)\n\ns = list(str(input()))\nt = list(str(input()))\n\ns.sort()\nt.sort(reverse=True)\n\ns = \"\".join(s)\nt = \"\".join(t)\n\nans = sorted([s, t])\n# print(ans)\n\nif ans[0] == t:\n    print(\"No\")\nelse:\n    print(\"Yes\")\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\ns = ''.join(s)\nt = ''.join(t)\nif s < t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.16, "memory": 14116.0, "status": "done"}, {"code": "s = str(input())\nt = str(input())\na = ''.join(sorted(s))\nb = ''.join(sorted(t, reverse=True))\nif a < b:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.16, "memory": 14284.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nS = \"\".join(sorted(list(s)))\nT = \"\".join(sorted(list(t), reverse=True))\n\nif S < T:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "S = sorted(input())\nT = sorted(input())[::-1]\nprint(\"Yes\" if S<T else \"No\")", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "S = sorted(input())\nT = sorted(input(), reverse=True)\n\nif S >= T:\n    print(\"No\")\nelse:\n    print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "s=list(input())\nt=list(input())\ns.sort()\nt.sort(reverse=True)\ns=\"\".join(s)\nt=\"\".join(t)\nif s < t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\nss = sorted(s)\ntt = sorted(t, reverse=True)\n\nsa = ''.join(ss)\nta = ''.join(tt)\n\nif sa < ta:\n  print('Yes')\nelse:\n  print('No')", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "list_s = sorted(list(input()))\nlist_t = sorted(list(input()), reverse=True)\nif \"\".join(list_s) < \"\".join(list_t): print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns.sort(reverse=False)\nt.sort(reverse=True)\n\nif \"\".join(s) < \"\".join(t):\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.21, "memory": 14144.0, "status": "done"}, {"code": "s, t = [input() for i in range(2)]\nns = ''.join(sorted(s))\nnt = ''.join(sorted(t, reverse=True))\nprint('Yes') if ns < nt else print('No')\n", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "s=sorted(list(input()))\nt=sorted(list(input()),reverse=True)\nfor i in range(min(len(s),len(t))):\n    if ord(s[i])<ord(t[i]):\n        print(\"Yes\")\n        return\n    elif ord(s[i])>ord(t[i]):\n        print(\"No\")\n        return\nif len(s)>=len(t):\n    print(\"No\")\nelse:\n    print(\"Yes\")", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(),reverse=True)\nif(s < t): print(\"Yes\")\nelse: print(\"No\")", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "s = input()\nt = input()\nS = sorted(s)\nT = sorted(t,reverse=True)\n#print(S,T)\nans = \"W\"\nfor i in range(min(len(s),len(t))):\n    if S[i] > T[i]:\n        ans = \"No\"\n        break\n    elif ans == \"W\" and S[i] == T[i]:\n        ans = \"W\"\n    elif ans == \"W\" and S[i] < T[i]:\n        ans = \"Yes\"\n        break\nif ans == \"W\":\n    if len(s) < len(t):\n        ans = \"Yes\"\n    else:\n        ans = \"No\"\nprint(ans)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "ss, ts = sorted(list(input())), list(reversed(sorted(list(input()))))\nresult = False\nmin_size = min(len(ss), len(ts))\n\nif ss[:min_size] == ts[:min_size] and len(ss) < len(ts):\n    result = True\nelse:\n    for index in range(min(len(ss), len(ts))):\n        if ss[index] < ts[index]:\n            result = True\n            break\n\nif result:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14284.0, "status": "done"}, {"code": "s = sorted(list(input()))\nt = sorted(list(input()),reverse=True)\nif s<t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "s=input()\nt=input()\n\ns_d = ''.join(sorted(s))\nt_d = ''.join(sorted(t,reverse=True))\n\narr = [t_d,s_d]\narr=sorted(arr)\n\nif s==t:\n    print('No')\n    return\n\nif arr[0]==s_d:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "s = str(input())\nt = str(input())\n\nnum2alpha = lambda c: chr(c+96)\n#print(num2alpha(3)) #==> c\nalpha2num = lambda c: ord(c) - ord('a') + 1\n#alpha2num('y') #==> 25 \n\nS = [0] * 26\nT = [0] * 26\nfor i in range(len(s)):\n  S[alpha2num(s[i]) - 1] += 1\nfor i in range(len(t)):\n  T[alpha2num(t[i]) - 1] += 1\n#print(S, T)  \n  \nss = 0\nwhile S[ss] == 0:\n  ss += 1\ntt = 25\nwhile T[tt] == 0:\n  tt -= 1\n  \nif tt < ss:\n  print(\"No\")\nelif tt > ss:\n  print(\"Yes\")\nelse:\n  if (T[tt] == sum(T)) and (S[ss] == sum(S)):\n    if sum(T) > sum(S):\n      print(\"Yes\")\n    else:\n      print(\"No\")\n  else:\n    print(\"No\")\n  \n  \n  \n\n  \n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(),reverse = True)\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\ns = list(input())\nt = list(input())\n\nN = len(s)\nM = len(t)\n\ns_d = sorted(s)\nt_d = sorted(t, reverse=True)\n\nans ='No'\nif N < M:\n    new_t = \"\".join(t_d[:N])\n    new_s = \"\".join(s_d)\n    if new_t == new_s:\n        ans ='Yes'\n\nif ans == 'No':\n    pos = 0\n    for i in range(min(N, M)):\n        if s_d[i]!=t_d[i]:\n            pos = i\n            break\n    if s_d[pos] < t_d[pos]:\n        ans ='Yes'\n\nprint(ans)", "passed": true, "time": 0.28, "memory": 14288.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nsorted_s = sorted(s)\nsorted_t = sorted(t, reverse=True)\n\n#print(sorted_s)\n#print(sorted_t)\n\nif sorted_s < sorted_t:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n\n", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "S = list(input())\nT = list(input())\n\nS.sort()\nT.sort(reverse=True)\n\nalpha = list('abcdefghijklmnopqrstuvwxyz')\n\ncheck = False\ncnt = 0\nfor s, t in zip(S,T):\n  res = alpha.index(s) - alpha.index(t)\n  if res < 0:\n    check = True\n    break\n  elif res == 0:\n    cnt += 1\n\nif cnt == len(S):\n  if len(S) < len(T):\n    check = True\n\nprint(\"Yes\" if check else \"No\")", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse = True)\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.16, "memory": 14320.0, "status": "done"}, {"code": "s = input()\nt = input()\n\ns = list(s)\nt = list(t)\ns.sort()\nt.sort(reverse=True)\n\ns = \"\".join(s)\nt = \"\".join(t)\n\nprint(\"Yes\") if s < t else print(\"No\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns.sort()\nt.sort(reverse=True)\n\ns = ''.join(s)\nt = ''.join(t)\n\nif s < t:\n    print('Yes')\nelse:\n    print('No')\n", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "S = input()\nT = input()\nS_len = len(S)\nT_len = len(T)\nS_sorted = sorted(S)\nT_sorted = sorted(T, reverse=True)\nans = True\nfor i in range(min(S_len, T_len)):\n    s = ord(S_sorted[i])\n    t = ord(T_sorted[i])\n    if s < t:\n        print('Yes')\n        return\n    if s == t:\n        continue\n    else:\n        print('No')\n        return\nif S_len >= T_len:\n    print('No')\nelse:\n    print('Yes')\n", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "s = input()\nt = input()\ns = sorted(s)\nt = sorted(t, reverse=True)\ns_t = [s, t]\ns_t.sort()\nif s_t[0] == s and s_t[1] != s:\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\ns.sort()\nt.sort(reverse=True)\n\nl = [''.join(s),''.join(t)]\n\nif l == sorted(l) and l[0]!=l[1]:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "s = input()\ns_asc = ''.join(sorted(s))\nt = input()\nt_desc = ''.join(sorted(t, reverse=True))\nif s_asc < t_desc:\n\tprint('Yes')\nelse:\n\tprint('No')", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nif \"\".join(sorted(s)) < \"\".join(list(reversed(sorted(t)))):\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "s = input()\nt = input()\n\nif \"\".join(sorted(s)) < \"\".join(sorted(t, reverse=True)):\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "a = list(input())\nb = list(input())\na.sort()\nb.sort()\nb.reverse()\na=''.join(a)\nb=''.join(b)\nif a < b:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = sorted(x for x in input())\nt = sorted([x for x in input()], reverse=True)\nprint('Yes' if s < t else 'No')", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "def main():\n  import sys\n  pin=sys.stdin.readline\n  pout=sys.stdout.write\n  perr=sys.stderr.write\n  S=input()\n  T=input()\n  if S==T:\n    print(\"No\")\n    return\n  if S in T:\n    print(\"Yes\")\n    return\n  s=list(S)\n  t=list(T)\n  \n  s.sort()\n  t.sort(reverse=True)\n  if s==t:\n    print(\"No\")\n    return\n  \n#  if(len(s)<len(t)):\n#    print(\"Yes\")\n#    return\n  for i in range(min(len(s),len(t))):\n    if ord(s[i])>ord(t[i]):\n      print(\"No\")\n      return\n    elif ord(s[i])<ord(t[i]):\n      print(\"Yes\")\n      return\n  print(\"No\")\n  return\nmain()", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "s=sorted(input())\nt=sorted(input())[::-1]\nprint(\"Yes\" if s<t else \"No\")", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\n\ndef main():\n    s = sorted(input())\n    t = sorted(input(), reverse=True)\n    if s < t:\n        print(\"Yes\")\n    else:\n        print(\"No\")\n\n\nmain()\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\ndef input():\n    return sys.stdin.readline()[:-1]\n\ndef main():\n    s = input()\n    t = input()\n\n    listS = []\n    for i in range(len(s)):\n        listS.append(s[i])\n\n    listT = []\n    for i in range(len(t)):\n        listT.append(t[i])\n\n    listS = sorted(listS)\n    listT = sorted(listT, reverse=True)\n\n    sortedS = ''\n    for i in range(len(listS)):\n        sortedS += listS[i]\n    sortedT = ''\n    for i in range(len(listT)):\n        sortedT += listT[i]\n\n    if sortedS < sortedT:\n        print('Yes')\n    else:\n        print('No')\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "s,t=sorted(list(input())),sorted(list(input()),reverse=True)\nprint(\"Yes\" if s<t else \"No\")", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "#ABC082\ns = sorted(input())\nt = sorted(input())[::-1]\nprint(\"Yes\" if s<t else \"No\")", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "s = input().rstrip()\nt = input().rstrip()\n\ns = tuple(sorted(s))\nt = tuple(sorted(t, reverse=True))\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(),reverse = True)\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input())[::-1]\nif s < t:\n  print(\"Yes\")\nelse:\n  print(\"No\")", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "s = input()\nt = input()\nif ''.join(sorted(s)) < ''.join(sorted(t, reverse=True)):\n    print('Yes')\nelse :\n    print('No')", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns.sort()\nt.sort(reverse = True)\n\nif s < t:\n    print('Yes')\nelse:\n    print('No')", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "s = sorted(input())\nt = sorted(input(), reverse=True)\nprint('Yes' if s < t else 'No')", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "def answer(s: str, t: str) -> str:\n    return 'Yes' if sorted(s) < sorted(t, reverse=True) else 'No'\n\ndef main():\n    s = input()\n    t = input()\n    print(answer(s,t))\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "s = input()\nt = input()\nimport sys\nif s==t:\n    print(\"No\")\n    return\nss = sorted(list(s))\ntt = sorted(list(t))[::-1]\nif sorted([ss,tt])[0] == ss:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.2, "memory": 14312.0, "status": "done"}, {"code": "s = list(input())\nt = list(input())\n\ns.sort()\nt.sort(reverse = True)\n\nfor i in range(min(len(s), len(t))):\n    if s[i] < t[i]:\n        print('Yes')\n        break\n    elif s[i] > t[i]:\n        print('No')\n        break\n    else:\n        continue\nelse:\n    if len(t) > len(s):\n        print('Yes')\n    else:\n        print('No')", "passed": true, "time": 0.16, "memory": 14108.0, "status": "done"}, {"code": "s=list(input())\nt=list(input())\n\ns.sort()\nt.sort(reverse=True)\n\nfor i in range(min(len(s),len(t))):\n    if(s[i]<t[i]):\n        print(\"Yes\")\n        return\n    if(s[i]>t[i]):\n        print(\"No\")\n        return\n\nif(len(s)<len(t)):\n    print(\"Yes\")\nelse:\n    print(\"No\")\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "s=input()\nt=input()\ns=sorted(s)\nt=sorted(t,reverse=True)\n\nprint('Yes' if s<t else 'No')", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "s = input()\nt = input()\n \nsp = sorted(s)\ntp = sorted(t, reverse=True)\n#print(sp, tp)\nprint(('Yes' if sp < tp else 'No'))\n", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "s, t = sorted(input()), sorted(input())[::-1]\n\nif \"\".join(s) < \"\".join(t):\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.23, "memory": 14092.0, "status": "done"}, {"code": "S = sorted(input())\nT = sorted(input())[::-1]\nprint('Yes' if S < T else 'No')", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "s = input()\nt = input()\nord_s = []\nord_t = []\n\nfor i in range(len(s)):\n  ord_s.append(ord(s[i]))\nelse:\n  ord_s.sort()\n  \nfor i in range(len(t)):\n  ord_t.append(ord(t[i]))\nelse:\n  ord_t.sort(reverse = True)\n\nfor i in range(min(len(s), len(t))):\n  if ord_s[i] < ord_t[i]:\n    print('Yes')\n    break\n  elif ord_s[i] == ord_t[i]:\n    pass\n  else:\n    print('No')\n    break\nelse:\n  if len(s) < len(t):\n    print('Yes')\n  else:\n    print('No')", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "s,t=[input() for i in range(2)]\nprint('Yes' if sorted(s)<sorted(t,reverse=True) else 'No')", "passed": true, "time": 0.13, "memory": 14252.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n    s = ins()\n    t = ins()\n    s = sorted(s)\n    t = sorted(t, reverse=True)\n    return s < t\n\n\nprint(\"Yes\" if solve() else \"No\")\n", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "s = input()\nt = input()\nif s < t:\n    print(\"Yes\")\n    return\ns = list(s)\nt = list(t)\ns = sorted(s)\nt = sorted(t)\nt = t[::-1]\ns = ''.join(s)\nt = ''.join(t)\nif s < t:\n    print(\"Yes\")\nelse:\n    print(\"No\")", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}]