Problem:
 Score : 200 points    Problem 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.      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 1 yx
axy      Sample Output 1 Yes  We can, for example, rearrange yx into xy and axy into yxa . Then, xy  <  yxa .       Sample Input 2 ratcode
atlas      Sample Output 2 Yes  We can, for example, rearrange ratcode into acdeort and atlas into tslaa . Then, acdeort  <  tslaa .       Sample Input 3 cd
abc      Sample Output 3 No  No matter how we rearrange cd and abc , we cannot achieve our objective.       Sample Input 4 w
ww      Sample Output 4 Yes       Sample Input 5 zzz
zzz      Sample Output 5 No

Solution (Python):
s = input()
t = input()
S = sorted(list(s))
T = sorted(list(t),reverse = True)
s1 = "".join(S)
s2 = "".join(T)
if sorted([s1,s2])[0] == s1 and s1 != s2:
    print("Yes")
else:
    print("No")

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
t=input()
sd=sorted(list(s))
td=sorted(list(t), reverse=True)
if(''.join(sd)<''.join(td)):
  print("Yes")
  exit()
print("No")

Solution (Python):
s = input()
t = input()

sp = sorted(s)
tp = sorted(t, reverse=True)

print('Yes' if sp < tp else 'No')

Solution (Python):
s = input()
t = input()

sp = sorted(s)
tp = sorted(t, reverse=True)

print('Yes' if sp < tp else 'No')

Solution (Python):

from string import ascii_lowercase as a


S = input()
T = input()


s = ''.join([a[n] for n in sorted([a.index(e) for e in S])])
t = ''.join([a[n] for n in sorted([a.index(e) for e in T], reverse = True)])


if s < t: res = 'Yes'
else: res = 'No'
print(res)

Solution (Python):

S = input()
T = input()


if len(set(S + T)) == 1 and len(S) < len(T):
    res = 'Yes'
else:
    res = 'No'
    for s in S:
        for t in T:
            if s < t:
                res = 'Yes'
                break


print(res)

Solution (Python):
s = ''.join(sorted(input()))
t = ''.join(sorted(input(), reverse=True))
print("Yes") if s<t else print("No")

Solution (Python):
s = input()
t = input()
s_lis = []
t_lis = []
for i in range(len(s)):
    s_lis.append(s[i])
for i in range(len(t)):
    t_lis.append(t[i])
s_lis.sort()
t_lis.sort(reverse = True)

s1 = ""
t1 = ""
for i in range(len(s_lis)):
    s1 += s_lis[i] 
for i in range(len(t_lis)):
    t1 += t_lis[i]

if s1 < t1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()
sd = []
for i in s:
    sd.append(i)
td = []
for j in t:
    td.append(j)
if sorted(sd) < sorted(td, reverse=True):
    print('Yes')
else:
    print('No')

Solution (Python):
a= input()
b=input()
print("Yes" if sorted(a)<sorted(b, reverse=True) else "No")

Solution (Python):
a= input()
b=input()
print("Yes" if sorted(a)<sorted(b)[::-1] else "No")

Solution (Python):
s = ''.join(sorted(list(input())))
t = ''.join(sorted(list(input()), reverse=True))
if s < t:
  print('Yes')
else:
  print('No')

Solution (Python):
a = sorted(input())
b = sorted(input())

b.reverse()

mojiA = ''.join(a)
mojiB = ''.join(b)

print("Yes") if mojiA<mojiB else print("No")

Solution (Python):
s = input()
s_asc = ''.join(sorted(s))

t = input()
t_dsc = ''.join(sorted(t, reverse = True))

if s_asc < t_dsc:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()
s2 = sorted(s)
t2 = sorted(t, reverse=True)
if s2 < t2:
  print("Yes")
else:
  print("No")

Solution (Python):


s = input()
t = input()

s_dash = "".join(sorted(s))
t_dash = "".join(sorted(t, reverse = True))

print("Yes" if s_dash < t_dash else "No")

Solution (Python):
s = input()
t = input()
S = ''.join(sorted(s))
T = ''.join(sorted(t, reverse=True))
cnt = 0
if T>S:
    print('Yes')

else:
    print('No')

Solution (Python):
s = input()
s_asc = ''.join(sorted(s))
 
t = input()
t_desc = ''.join(sorted(t, reverse=True))
 
if s_asc < t_desc:
	print('Yes')
else:
	print('No')

Solution (Python):
s = input()
t = input()
check = False
for i in range(len(s)):
    s = s[len(s)-1] + s[:len(s)-1]
    for j in range(len(t)):
        t = t[len(t)-1] + t[:len(t)-1]
        if s < t:
            check = True
            break
    if check:
       break
if check:
    print("Yes")
else:
    print("No")

Solution (Python):
s, t = (input() for _ in range(2))
s_asc = ''.join(sorted(s))
t_desc = ''.join(sorted(t, reverse = True))
if s_asc < t_desc:
    print('Yes')
else:
    print('No')

Solution (Python):
s, t = (input() for _ in range(2))
new_s = ''.join(sorted(s))
new_t = ''.join(sorted(t, reverse = True))
lst = sorted([new_s, new_t])
if lst.index(new_s) == 1 or new_s == new_t:
    print('No')
else:
    print('Yes')

Solution (Python):
s = sorted(list(input()))
t = sorted(list(input()), reverse = 1)
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s=sorted(input())
t=sorted(input())[::-1]
print('Yes' if s<t else 'No')

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
Ls= []
Lt= []

if len(s)<len(t) and set(s) == set(s)&set(t):
    print("Yes")
else:
    for i in s:
        Ls.append(i)
    Ls = "".join(Ls)
    for i in t:
        Lt.append(i)
    Lt = "".join(Lt)
    L = [Ls,Lt]
    L = sorted(L)
    if L[0]==L[1]:
        print("No")
    elif L[0]==Ls:
        print("Yes")
    else:
        print("No")

Solution (Python):
s=sorted(list(input()))
t=sorted(list(input()),reverse=True)
n=min(len(s),len(t))
flag=False
if s[:n]==t[:n] and len(s)<len(t):
  flag=True
else:
  for i in range(n):
    if ord(s[i])<ord(t[i]):
      flag=True
      break
print(['No','Yes'][flag])

Solution (Python):
S = sorted(input())
T = sorted(input(),reverse=True)
print("Yes" if T>S else "No")

Solution (Python):
s=list(input())
t=list(input())
s=''.join(sorted(s))
t=''.join(sorted(t, reverse=True))

if s<t:
  print('Yes')
else:
  print('No')

Solution (Python):


s = input()
t = input()

s_sorted = sorted(s)
t_sorted = list(reversed(sorted(t)))

print('Yes' if s_sorted < t_sorted else 'No')

Solution (Python):
s = input()
t = input()
list_s = list(s)
list_s.sort()
list_t = list(t)
list_t.sort(reverse=True)
if "".join(list_s)<"".join(list_t):
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
t = input()
print("Yes" if sorted(s)<sorted(t)[::-1] else "No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)

if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
s = sorted(input())
t = sorted(input(), reverse = True)
print("Yes" if s < t else "No")

Solution (Python):
s = input()
t = input()

s_prime = "".join(sorted(list(s)))
t_prime = "".join(sorted(list(t), reverse=True))

if s_prime == t_prime:
  print("No")
elif [s_prime, t_prime] == sorted([s_prime, t_prime]):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
input=sys.stdin.readline

def main():

    s = input().strip()
    t = input().strip()
    if sorted(s) < sorted(t, reverse=True):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Solution (Python):
import sys
input=sys.stdin.readline

def main():

    s = input().strip()
    t = input().strip()
    s = "".join(sorted(s))
    t = "".join(sorted(t, reverse=True))
    if s < t:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    s = input()
    t = input()
    sp = "".join(sorted(list(s)))
    tp = "".join(sorted(list(t), reverse = True))
    if sp < tp:
        return "Yes"
    return "No"

if __name__ == '__main__':
    print(main())

Solution (Python):
s = ''.join(list(sorted(list(input()))))
t = ''.join(list(sorted(list(input()), reverse = True)))
print('Yes' if s < t else 'No')

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
print('Yes' if s<t else 'No')

Solution (Python):
s = "".join(sorted(list(input())))
t = "".join(sorted(sorted(list(input())),reverse=True))
a = list([t, s])
print("Yes" if sorted(a).pop() is t else "No")

Solution (Python):
s = input()
s_asc = ''.join(sorted(s))

t = input()
t_desc = ''.join(sorted(t, reverse=True))

if s_asc < t_desc:
	print('Yes')
else:
	print('No')

Solution (Python):
s = input()
t = input()
if "".join(sorted(s)) < "".join(sorted(t,reverse=True)):
    print("Yes")
else:
    print("No")

Solution (Python):
s, t = [input() for _ in range(2)]
print('Yes' if sorted(s) < sorted(t)[::-1] else 'No')

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
s = ''.join(s)
t = ''.join(t)
if s < t:
  print('Yes')
else:
  print('No')

Solution (Python):
s, t = [input() for _ in range(2)]
print('Yes' if sorted(s) < sorted(t, reverse=True) else 'No')

Solution (Python):
s = input()
s_asc = ''.join(sorted(s))
 
t = input()
t_desc = ''.join(sorted(t, reverse=True))


if s_asc < t_desc:
	print('Yes')
else:
	print('No')

Solution (Python):
s=list(map(ord, input()))
t=list(map(ord, input()))
s.sort()
t.sort(reverse=True)
print('Yes' if s<t else 'No')

Solution (Python):
s=input()
t=input()
c=""
d=""
lista=list()
sa=sorted(s)
ta=sorted(t,reverse=True)
for i in sa:
    c=c+i
for x in ta:
    d=d+x
lista.append(c)
lista.append(d)
if s==t:
    print("No")
elif lista==sorted(lista):
    print("Yes")
else:
    print("No")

Solution (Python):
a=sorted(input())
b=sorted(input())[::-1]
if a<b:
    print('Yes')
else:
    print('No')

Solution (Python):
a = sorted(input())
b = sorted(input())[::-1]
if a < b:
    print("Yes")
else:
    print("No")

Solution (Python):
print("Yes" if sorted(input())<sorted(input())[::-1] else "No")

Solution (Python):
s="".join(sorted(list(input())))
t="".join(sorted(list(input()),reverse=True))


if len(s)<len(t) and s==t[:len(s)]:
    print("Yes")
else:
    for i in range(min([len(s),len(t)])):
        if s[i]!=t[i]:
            if s[i]<t[i]:
                print("Yes")
            else:
                print("No")
            break
        if i==min([len(s),len(t)])-1:
            print("No")

Solution (Python):
s=input()
t=input()

ss=''.join(sorted(s))
tt=''.join(sorted(t,reverse=True))

if ss<tt:
    print('Yes')
else:
    print('No')

Solution (Python):
s1 = input()
s2 = input()

s1 = sorted(s1)
s2 = sorted(s2)
s2 = s2[::-1]

s1 = "".join(s1)
s2 = "".join(s2)

array = [s1,s2]
exchange = sorted(array)

if array[0]==exchange[0] and s1!=s2:
  print("Yes")
else:
  print("No")

Solution (Python):
s=input()
d=input()
v=sorted(list(map(str,s)))
w=sorted(list(map(str,d)),reverse=True)
a=""
b=""
for i in range(len(s)):
  a += v[i]
for c in range(len(d)):
  b += w[c]
if a==b:
  print("No")
else:
  print("Yes") if max([a,b])==b else print("No")

Solution (Python):
s=[s for s in input()]
s.sort()
S=''.join(s)
t=[s for s in input()]
t.sort(reverse=True)
T=''.join(t)
print('Yes' if s<t else 'No')

Solution (Python):
s = ''.join(sorted(input()))
t = ''.join(sorted(input())[::-1])
print('Yes' if s < t else 'No')

Solution (Python):
ss = ''.join(sorted(input()))
tt = ''.join(sorted(input(), reverse=True))

if ss<tt:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
t = input()
print('Yes' if sorted(s)<sorted(t)[::-1] else 'No')

Solution (Python):
s = input()
t = input()
s_sorted = ''.join(sorted(s))
t_sorted = ''.join(sorted(t, reverse=True))
if s_sorted < t_sorted:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()
ss = sorted(s)
tt = sorted(t)
print("Yes" if ss < tt[::-1] else "No")

Solution (Python):
s=input()
t=input()
s="".join(sorted(s))
t="".join(sorted(t, reverse=True))
if s<t:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
t = input()
S = "".join(sorted(s))
T = "".join(sorted(t, reverse=True))
print("Yes" if S < T else "No")

Solution (Python):
s = ''.join(sorted(input()))
t = ''.join(sorted(input(), reverse=True))
original = [s, t]
ans = sorted(original)
if s == t:
    print('No')
else:
    if original == ans:
        print('Yes')
    else:
        print('No')

Solution (Python):
s = input()
sd = ''.join(sorted(s))
t = input()
td = ''.join(sorted(t, reverse=True))

if(td > sd):
  print('Yes')
else:
  print('No')

Solution (Python):
s = "".join(sorted(list(input())))
t = "".join(sorted(list(input()), reverse=True))
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s=sorted(input())
t=sorted(input())
t.sort(reverse=True)
print("Yes" if s<t else "No")

Solution (Python):
s = sorted(input(), reverse=False)
t = sorted(input(), reverse=True)

if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
if s < t:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
t = input()
s = sorted(s)
t = sorted(t,reverse = True)
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
a = [s,t]
a.sort()

if a[0] == s and a[1] != s:
    print("Yes")
else:
    print("No")

Solution (Python):

s = sorted(input())

t = sorted(input())[::-1]

print("Yes" if s<t else "No")

Solution (Python):

s = sorted(input())

t = sorted(input())[::-1]

print("Yes" if s<t else "No")

Solution (Python):
s = input()
t = input()

print('Yes' if ''.join(sorted(s)) < ''.join(sorted(t,reverse=True)) else 'No')

Solution (Python):
s, t = [list(input()) for _ in range(2)]

ss = sorted(s)
tt = sorted(t, reverse=True)

if ss < tt:
  print("Yes")
else:
  print("No")

Solution (Python):
s, t = [list(input()) for _ in range(2)]

s.sort()
ss = "".join(s)

t.sort(reverse=True)
tt = "".join(t)

if ss == tt:
  print("No")
  exit()

li=[ss, tt]
li.sort()

if li[0] == ss:
  print("Yes")
else:
  print("No")

Solution (Python):
print("Yes" if sorted(input())<sorted(input())[::-1] else "No")

Solution (Python):
s = input()
t = input()
sdash = "".join(sorted(s))
tdash = "".join(reversed(sorted(t)))
print('Yes' if sdash < tdash else 'No')

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
s = "".join(s)
t = "".join(t)




if s < t:
  print("Yes")
else:
  print("No")

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
print("Yes" if s<t else "No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
js = ''.join(s)
jt = ''.join(t)
if js < jt:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
t = input()
s1 = "".join(sorted(s))
t1 = "".join(sorted(t, reverse=True))
if s1 < t1:
    print("Yes")
else:
    print("No")

Solution (Python):
print("Yes" if sorted(input())<sorted(input(),reverse=True) else "No")

Solution (Python):
a=list(input())
b=list(input())
if a==b:
  print("No")
else:
  a.sort()
  a="".join(a)
  b.sort()
  b=b[::-1]
  b="".join(b)
  list_ = [a,b]
  list_.sort()
  if list_[0]==a:
    print("Yes")
  else:
    print("No")

Solution (Python):
s=str(input())
t=str(input())
S="".join(sorted(list(s)))
T="".join(sorted(list(t),reverse = True))
print("Yes" if S<T else "No")

Solution (Python):
S, T = input(), input()
s, t = sorted(S), sorted(T, reverse=True)

for i in range(min(len(s), len(t))):
    if s[i] < t[i]:
        print("Yes")
        break
    if s[i] > t[i]:
        print("No")
        break
else:
    if len(s) < len(t):
        print("Yes")
    else:
        print("No")

Solution (Python):
s = input()
t = input()

t1 = sorted(t,reverse=True)
s1 = sorted(s)

hantei = 0
count = 0

if len(s1) < len(t1):
    for i in range(len(s1)):
        count += 1
        if t1[i] > s1[i]:
            hantei = 1
            break
        elif t1[i] < s1[i]:
            break
        elif count == len(s1):
            hantei = 1
            break

else :
     for i in range(len(t1)):
        if t1[i] > s1[i]:
            hantei = 1
            break
        elif t1[i] < s1[i]:
            break

if hantei == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
if s < t:
  print("Yes")
else:
  print("No")

Solution (Python):
s = ''.join(sorted(input()))
t = ''.join(sorted(input(), reverse=True))

if s == t:
    print('No')
    exit()

temp = [s, t]  
if temp == sorted(temp):
    print('Yes')
else:
    print('No')

Solution (Python):
s = sorted(input())
t = sorted(input())[::-1]
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):

s = input()
t = input()
print('Yes') if sorted(s) < sorted(t,reverse=True) else print('No')

Solution (Python):
sl=list(input())
tl=list(input())
chara="abcdefghijklmnopqrstuvwxyz"
chl=list(chara)
sl.sort()
tl.sort(reverse=True)
s="".join(sl)
t="".join(tl)

if s<t :
  print("Yes")
else :
  print("No")

Solution (Python):
if "".join(sorted(input())) < "".join(sorted(input(), reverse=True)):
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())

s.sort(reverse = False)
t.sort(reverse = True)

print ("Yes" if s<t else "No")

Solution (Python):
if ''.join(sorted(input()))<''.join(sorted(input(),reverse=True)):
  print('Yes')
else:
  print('No')

Solution (Python):
x = list(input())
y = list(input())

x.sort()
y.sort(reverse=True)

s = ''.join(x)
t = ''.join(y)
if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
t = input()

s_sort = sorted(s)
t_sort = sorted(t,reverse= True)

if s_sort < t_sort:
    print('Yes')
else:
    print('No')

Solution (Python):

s = sorted(input())
t = sorted(input(), reverse=True)
print('Yes' if s < t else 'No')

Solution (Python):
s = input()
t = input()
ss = ''.join(sorted(s))
tt = ''.join(sorted(t,reverse = True))
c = [ss,tt]
cc = sorted(c)
if cc[0] == ss and cc[0] != cc[1]:
    print('Yes')
else:
    print('No')

Solution (Python):
a = sorted(list(input()))
b = sorted(list(input()),reverse=True)
if a < b:
  print('Yes')
else:
  print('No')

Solution (Python):

s = ''.join(sorted(input()))
t = ''.join(sorted(input(), reverse = True))
if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
a = input()
b = input()

c = ''.join(sorted(a))
d = ''.join(sorted(b, reverse=True))

if c < d:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input().rstrip("\n")
t = input().rstrip("\n")

print("Yes" if sorted(s) < sorted(t, reverse=True) else "No")

Solution (Python):
a = input()
b = input()
A = []
B = []
for i in range(len(a)):
  A.append(a[i])
for j in range(len(b)):
  B.append(b[j])
A.sort()
B.sort()
B.reverse()
aa = ''
bb = ''
for i in range(len(a)):
  aa += A[i]
for j in range(len(b)):
  bb += B[j]
if aa < bb:
  print('Yes')
else:
  print('No')

Solution (Python):
s, t = [input() for _ in range(2)]
print('Yes' if sorted(s) < sorted(t, reverse=True) else 'No')

Solution (Python):
s = input()
t = input()

s_abc = "".join(sorted(s))
t_cba = "".join(sorted(t,reverse=True))
if s_abc<t_cba:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
ans = "No"
cnt = 0
for i in range(min(len(s), len(t))):
    if ord(s[i]) < ord(t[i]):
        ans = "Yes"
        break
    elif ord(s[i]) == ord(t[i]):
        cnt += 1
if cnt == min(len(s), len(t)) and len(s) < len(t):
    ans = "Yes"
print(ans)

Solution (Python):
I=lambda:"".join(sorted(list(input())))
print("YNeos"[I()>=I()[::-1]::2])

Solution (Python):
s = ''.join(sorted(list(input())))
t = ''.join(sorted(list(input()), reverse=True))

if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
if "".join(s) < "".join(t):
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())

s.sort()
t.sort()

i = 0
j = len(t) - 1
while True:
    if s[i] < t[j]:
        print('Yes')
        exit()
    elif s[i] > t[j]:
        print('No')
        exit()
    else:
        i += 1
        j -= 1
        if j < 0:
            print('No')
            exit()
        if i >= len(s):
            print('Yes')
            exit()

Solution (Python):
s = input()
s_asc = ''.join(sorted(s))
t = input()
t_desc = ''.join(sorted(t, reverse = True))
if s_asc < t_desc:
    print('Yes')
else:
    print('No')

Solution (Python):
s=sorted(input())
t=sorted(input())[::-1]
print('Yes' if s<t else'No')

Solution (Python):
s = sorted(list(input()))
t = sorted(list(input()))
t.reverse()

len_s = len(s)
len_t = len(t)

ans = 'None'

for s_, t_ in zip( s,t ):
  if ord(s_) < ord(t_):
    ans = 'Yes'
    break
  elif ord(s_) > ord(t_):
    ans = 'No'
    break

if ans == 'None':
  if len_s < len_t:
    ans = 'Yes'
  else:
    ans = 'No'
    
print(ans)

Solution (Python):
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

print('Yes' if s<t else 'No')

Solution (Python):
s = input()
t = input()

s_sort = sorted(s)
t_sort = sorted(t, reverse=True)

if s_sort < t_sort:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
s_ascending = ''.join(sorted(s))

t = input()
t_descending = ''.join(sorted(t, reverse=True))

if s_ascending < t_descending:
    print('Yes')
else:
    print('No')

Solution (Python):
s = "".join(sorted(input()))
t = "".join(sorted((input()))[::-1])
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
t=input()
S=[]
T=[]
for i in range(len(s)):
	S.append(ord(s[i]))
for i in range(len(t)):
	T.append(ord(t[i]))
if min(S)<max(T):
	print("Yes")
elif min(S)>max(T):
	print("No")
else:
	S.sort()
	T.sort()
	for i in range(1,min(len(s),len(t))):
		if S[i]<T[-i-1]:
			print("Yes")
			exit()
		elif S[i]>T[-i-1]:
			print("No")
			exit()
	if len(s)<len(t):
		print("Yes")
	else:
		print("No")

Solution (Python):
s = input()
t = input()

ss = ''.join(sorted(s))
tt = ''.join(sorted(t , reverse = True))

if ss < tt:
    print('Yes')
else:
    print('No')

Solution (Python):
ss = input()
tt = input()
s = "".join(sorted(list(ss)))
t = "".join(sorted(list(tt), reverse = True))
l = sorted([s,t])
if l[0] == l[1]:
    print("No")
elif l[0] == s:
    print("Yes")
else:
    print("No")

Solution (Python):
s = sorted(list(input()))
t = sorted(list(input()),reverse=1)
print('YNeos'[''.join(s) >= ''.join(t)::2])

Solution (Python):
s = input()
t = input()
sl = [char for char in s]
tl = [char for char in t]
sl.sort()
tl.sort()
tl.reverse()
ss = ''.join(sl)
tr = ''.join(tl)
if tr > ss:
  print('Yes')
else:
  print('No')

Solution (Python):
s=sorted(input())
t=sorted(input())

if s<t[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
s_given = list(input())
t_given = list(input())

s_len = len(s_given)
t_len = len(t_given)
s_sorted = sorted(s_given)
t_sorted = sorted(t_given, reverse=True)

for i in range(t_len):
    if s_sorted[i] < t_sorted[i]:
        print('Yes')
        break
    elif s_sorted[i] > t_sorted[i]:
        print('No')
        break

    
    if i == t_len - 1:
        print('No')
        break
    elif i == s_len - 1 :
        print('Yes')
        break

Solution (Python):
import random
s_given = list(input())
t_given = list(input())

s_len = len(s_given)
t_len = len(t_given)
s_sorted = sorted(s_given)
t_sorted = sorted(t_given, reverse=True)

for i in range(t_len):
    if s_sorted[i] < t_sorted[i]:
        print('Yes')
        break
    elif s_sorted[i] > t_sorted[i]:
        print('No')
        break
    if i == t_len - 1:
        print('No')
        break
    elif i == s_len - 1 :
        print('Yes')
        break

Solution (Python):
s = input()
t = input()

sdash = "".join(sorted(s))
tdash = "".join(sorted(t, reverse = True))

print("Yes" if sdash < tdash else "No")

Solution (Python):
print("Yes" if sorted(list(input())) < sorted(list(input()),reverse=True) else "No")

Solution (Python):

import sys
INF = float("inf")


def yes():
    print("Yes")  


def no():
    print("No")  


def solve(s: str, t: str):
    s = "".join(sorted(list(s)))
    t = "".join(sorted(list(t), reverse=True))
    if s < t:
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  
    t = next(tokens)  
    solve(s, t)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
s_sorted = ''.join(sorted(s))
t = input()
t_sorted = ''.join(sorted(t,reverse = True))
if s_sorted < t_sorted:
	print("Yes")
else:
	print("No")

"""
'間に挿入する文字列'.join([連結したい文字列のリスト])
発想
sを辞書順で一番早くなるよう並び替え
tを辞書順で一番遅くなるよう並び替え
それらを比較
"""

Solution (Python):
s = list(str(input()))
t = list(str(input()))

s.sort()
t.sort()
t.reverse()

def cond1(s,t):
    n = len(s)
    m = len(t)
    if(n >= m):
        return False
    else:
        for i in range(n):
            if(ord(s[i]) != ord(t[i])):
                return False
        return True

def cond2(s,t):
    m = min(len(s),len(t))
    for i in range(m):
        if(ord(s[i]) < ord(t[i])):
            return True
        elif(ord(s[i]) > ord(t[i])):
            return False
    return False

ans = (cond1(s,t) or cond2(s,t))

if(ans):
    print("Yes")
else:
    print("No")

Solution (Python):
s=list(input())
t=list(input())

s.sort()
t.sort(reverse=True)

s=''.join(s)
t=''.join(t)

if s<t:
  print('Yes')
  
else:
  print('No')

Solution (Python):
A = "".join((sorted(input())))
B = "".join(sorted(input(), reverse=True))
print("Yes" if A < B else "No")

Solution (Python):
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")

Solution (Python):
s = sorted(list(input()))
t = sorted(list(input()), reverse = True)
print("Yes" if s < t else "No")

Solution (Python):
print("Yes") if "".join(sorted(list(input()))) < "".join(sorted(list(input())))[::-1] else print("No")

Solution (Python):
S="".join(sorted(list(input())))
T="".join(sorted(list(input())))[::-1]
if S<T:
  print("Yes")
else:
  print("No")

Solution (Python):
import itertools
s=input()
t=input()
S="".join(sorted(list(s)))
T="".join(sorted(list(t)))[::-1]
if S<T:
  print("Yes")
else:
  print("No")

Solution (Python):
S = list(input())
T = list(input())

S.sort()
T.sort(reverse=True)

if S >= T:
    print('No')
else:
    print('Yes')

Solution (Python):
S = list(input())
T = list(input())

S.sort()
T.sort(reverse=True)

n = len(S)
m = len(T)

for i in range(min(n,m)):
    if S[i] > T[i]:
        print('No')
        exit()
    elif S[i] < T[i]:
        print('Yes')
        exit()

if n >= m:
    print('No')
else:
    print('Yes')

Solution (Python):
s = [i for i in input().strip()]
t = [i for i in input().strip()]

s.sort()
t.sort(reverse=True)




if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
if s < t:
    print("Yes")
else:
    print("No")

Solution (Python):
s = sorted(input())
t = sorted(input(),reverse=True)

if s<t:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
t = input()

s = sorted(s)
t = list(reversed(sorted(t)))

if s < t:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
t = input()

sedit = sorted(s)
tedit = sorted(t, reverse=True)

if ''.join(sedit) < ''.join(tedit):
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

for i in range(len(t)):
  if i > len(s)-1:
    print('Yes')
    exit()
  elif s[i] == t[i]:
    continue
  elif s[i] > t[i]:
    print('No')
    exit()
  else:
    print('Yes')
    exit()
if len(t) > len(s):
  print('Yes')
else:
  print('No')

Solution (Python):
s=list(input())
t=list(input())

s.sort() 
t.sort(reverse = True)

if s < t:
 print("Yes")
else:
 print("No")

Solution (Python):
import math







string1 = input()
string2 = input()


ls1 = list(string1)
ls1.sort()
string1 = "".join(ls1)
ls2 = list(string2)
ls2.sort(reverse=True)
string2 = "".join(ls2)
if string1 < string2:
  print("Yes")
else:
  print("No")

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math






def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    s = list(input())
    t = list(input())
    
    s.sort()
    t.sort()
    t.reverse()
    
    s = "".join(s)
    t = "".join(t)
    
    if s < t:
        print("Yes")
    else:
        print("No")
            	
if __name__ == "__main__":
	main()

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
l = []

a = list(input())
a.sort()
a = ''.join(a)
l.append([a,'a'])
b = list(input())
b.sort(reverse=True)
b = ''.join(b)
l.append([b,'b'])

l.sort()

if a != b:
  if l[0][1] == 'a':
    print('Yes')
  else:
    print('No')
else :
  print('No')

Solution (Python):
s = sorted(list(input()))
t = sorted(list(input()), reverse = True)
S = ''.join(s)
T = ''.join(t)
if S < T:
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
if s < t:
    print('Yes')
else:
    print('No')

Solution (Python):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
print('Yes') if s < t else print('No')

Solution (Python):
a = list(input())
b = list(input())

a.sort()
b.sort(reverse=True)
print("Yes") if a<b else print("No")

Solution (Python):
a = input()
b = input()

a = sorted(a)
b = sorted(b, reverse=True)

if a < b:
    print("Yes")
else:
    print("No")

Solution (Python):
a = input()
b = input()

a = sorted(a)
b = sorted(b, reverse=True)

if a < b:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
t = list(input())

if s < t or sorted(s) < t or sorted(s) < sorted(t, reverse=True):
    print('Yes')
else: print('No')

Solution (Python):
s = list(str(input()))
t = list(str(input()))

s.sort()
t.sort()



if s < t[::-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
a = list(input())
b = list(input())
a.sort()
b = sorted(b, reverse=True)
for i in range(min(len(a), len(b))):
    if a[i] < b[i]:
        print("Yes")
        exit()
    elif a[i] > b[i]:
        print("No")
        exit()
if len(a) >= len(b):
    print("No")
else:
    print("Yes")

Solution (Python):
x=list(input())
y=list(input())

x.sort()
y.sort()
y.reverse()

x1=''.join(x)
y1=''.join(y)
if x1<y1:
    print('Yes')
else:
    print('No')

Solution (Python):
s = sorted([i for i in input()])
t = sorted([i for i in input()], reverse=True)

if s < t:
  print("Yes")
else:
  print("No")

Solution (Python):
s=''.join(sorted(list(map(str,input()))))
t=''.join(sorted(list(map(str,input())),reverse=True))
print('YNeos'[s>=t::2])