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



Sample input:
yx
axy


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort(reverse=1)
i=0
while 1>0:
  if m[i]<n[i]:
    print("Yes")
    break
  i+=1
  if i==len(a) or i==len(b):
    print("No")
    break

Submission status: Wrong Answer

Solution code:
a=input()
m=[a[i] for i in range(len(a))]
b=input()
n=[b[i] for i in range(len(b))]
m.sort()
n.sort()
i=0
while 1>0:
  if m[i]<n[i]:
    print("Yes")
    break
  i+=1
  if i==len(a) or i==len(b):
    print("No")
    break

Submission status: Wrong Answer

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

ss = "".join(sorted(s))
tt = "".join(sorted(t))

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

Submission status: Wrong Answer

Solution code:
hoge=list(input())
huga=list(input())
hoge.sort()
huga.sort(reverse=True)
print(hoge)
print(huga)

flag=0

for i in range(min(len(hoge),len(huga))):
  print(i)
  if(hoge[i]>huga[i]):
    flag=1
    break
  elif(hoge[i]<huga[i]):
    flag=-1
    break

if(flag==0):
  if(len(hoge)>=len(huga)):
    flag=1
    
    
if(flag==1):
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
hoge=list(input())
huga=list(input())
hoge.sort()
huga.sort()

flag=0

for i in range(min(len(hoge),len(huga))):
  if(hoge[i]>huga[i]):
    flag=1
if(flag==0):
  if(len(hoge)>len(huga)):
    flag=1
    
if(flag==0):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
s = "".join(s)
t = "".join(s)
if s < t:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a=0
s=input()
t=input()
for i in range(0,len(s)):
    for j in range(0,len(t)):
        if s[i]<t[j]:
            a+=1
if a>=1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a=0
s=input()
t=input()
for i in range(1,len(s)):
    for j in range(1,len(t)):
        if s[i]<t[j]:
            a+=1
if a>=1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

size = min(len(s), len(t))
result = ""

for i in range(size):
    if s[i] < t[i]:
        result = "Yes"
        break

if result == "":
    if s[0:size] == t[0:size]:
        if len(s) < len(t):
            result = "Yes"
    else:
        result = "No"

print(result)

Submission status: Wrong Answer

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

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

ss = sorted(s) #文字単位でソート
tt = sorted(t)

sss = "".join(ss) #文字列に連結
ttt = "".join(tt)


A = [sss, ttt] #リストにまとめる
A.sort()

if A[0] == sss:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

ss = sorted(s) #文字単位でソート
tt = sorted(t)

sss = "".join(ss) #文字列に連結
ttt = "".join(tt)


A = [sss, ttt] #リストにまとめる
A.sort()

if A[0] == sss:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
#print(s,t)

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
print(s,t)

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort(reverse=True)
t.sort(reverse=True)
#print(x,y)

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

Submission status: Wrong Answer

Solution code:
#82
s = sorted(input())
t = sorted(input(), reverse=True)
if len(s)<=len(t):
    for i in range(min(len(s),len(t))):
        if s[i]<t[i]:
            print("Yes")
            break
        elif s[i]>t[i]:
            print("No")
            break
        if i==min(len(s),len(t))-1:
            if len(s)<len(t):
                print("Yes")
            else:
                print("No")

Submission status: Wrong Answer

Solution code:
#82
s = sorted(input())
t = sorted(input(), reverse=True)
if len(s)<=len(t):
    for i in range(min(len(s),len(t))):
        if s[i]<t[i]:
            print("Yes")
            break
        elif s[i]>t[i]:
            print("No")
            break
        if i==len(s)-1:
            if len(s)<len(t):
                print("Yes")
            else:
                print("No")

Submission status: Wrong Answer

Solution code:
#82
s = sorted(input())
t = sorted(input(), reverse=True)
if len(s)<=len(t):
    for i in range(len(s)):
        if s[i]<t[i]:
            print("Yes")
            break
        elif s[i]>t[i]:
            print("No")
            break
        if i==len(s)-1:
            print("No")
else:
    for i in range(len(t)):
        if s[i]<t[i]:
            print("Yes")
            break
        elif s[i]>t[i]:
            print("No")
            break
        if i==len(t)-1:
            print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t,reverse=True)
if len(s)>=len(t):
    print("No")
    exit()
for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        exit()
    elif ord(s[i])>ord(t[i]):
        print("No")
        exit()
else:
    if len(t)-len(s)>0:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
x1 = ''.join(sorted(x))
y1 = ''.join(reversed(y))
if x1 < y1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = [i for i in S()]
t = [i for i in S()]

s.sort()
t.sort(reverse=True)
for a,b in zip(s,t):
    if a < b:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s=input()
s_=sorted(s)
s=''.join(s_)
t=input()
t_=sorted(t)
t=''.join(t_)
if s<t:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
tiisaku = input()
ookiku = input()

len1 = len(tiisaku)
len2 = len(ookiku)

for i in range(len1 - 1):
    if tiisaku[i] > tiisaku[i+1]:
        tiisaku = tiisaku[0:i] + tiisaku[i+1] + tiisaku[i] + tiisaku[i+2:len1]

for i in range(len2 - 1):
    if ookiku[i] < ookiku[i+1]:
        ookiku = ookiku[0:i] + ookiku[i+1] + ookiku[i] + ookiku[i+2:len2]

if tiisaku < ookiku:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
tiisaku = input()
ookiku = input()

len1 = len(tiisaku)
len2 = len(ookiku)

for i in range(len1 - 1):
    if tiisaku[i] > tiisaku[i+1]:
        tiisaku = tiisaku[0:i] + tiisaku[i+1] + tiisaku[i] + tiisaku[i+2:len1]

for i in range(len2 - 1):
    if ookiku[i] < ookiku[i+1]:
        ookiku = ookiku[0:i] + ookiku[i+1] + ookiku[i] + ookiku[i+2:len2]

print(tiisaku)
print(ookiku)

if tiisaku < ookiku:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
x=list(input())
y=list(input())
x.sort();y.sort(reverse=True)
x=str(x);y=str(y)
if x<y:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
x=list(input())
y=list(input())
x.sort();y.sort()
if x==y:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
s = sorted({i for i in input()})
t = sorted({i for i in input()})[::-1]
print(["No", "Yes"][s[0]<t[0]])

Submission status: Wrong Answer

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

boolist = []
dict_s = sorted({i for i in s})[::-1]
dict_t = sorted({i for i in t})[::-1]

count = [len(dict_s), len(dict_t)][len(dict_s) > len(dict_t)]-1

if len(dict_s) == len(dict_t):
    print(["No", "Yes"][len(s) < len(t)])
else:
    for i in range(count):
        if dict_s[i] < dict_t[i]:
            boolist.append(True)
    print(["No", "Yes"][True in boolist])

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
s.sort
t.sort(reverse=True)
a=""
b=""
for i in range(len(s)):
    a=a+s[i]
for j in range(len(t)):
    b=b+t[j]
if a<b:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    a,b = LI()
    print((a+b)//2)

#B
def B():
    s = S()
    t = S()
    s.sort()
    t.sort()
    t = t[::-1]
    l = [s,t]
    l.sort()
    if l[0] == s:
        print("Yes")
    else:
        print("No")
#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Wrong Answer

Solution code:
ss = sorted([i for i in input()])
ts= sorted([i for i in input()],reverse = True)
check = True
for ins,intt in zip(ss,ts):
    if ins<intt:
        print("Yes")
        check = False
        break
    else:
        continue
if check == True and len(ss)<len(ts):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if sorted(a) < sorted(b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

for x in a:
    for y in b:
        if x < y or (x <= y and len(a) < len(b)):
            print('Yes')
            exit()
print('No')

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
flag=0
for i in s:
    for j in t:
        if i<j:
            flag=1
            break
        elif i==j:
            flag=1
        else:
            flag=0
if flag and len(s)<len(t):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
flag=0
for i in s:
    for j in t:
        if i<j:
            flag=1
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

def isLarge( s, t ):
    ss = sorted( s )
    st = sorted( t, reverse=True )
    for i in range( min(len(ss), len(st)) ):
        if st[i] > ss[i]: return True
    if len(t) > len(s): return True
    return False

if isLarge( s, t ): print( 'Yes' )
else              : print( 'No' )

Submission status: Wrong Answer

Solution code:
s,t = map(str, [input() for i in range(2)])

S = [s[i] for i in range(len(s))]
T = [t[i] for i in range(len(t))]


def XY(x, y):
    x.sort()
    y.sort(reverse=True)
    c = 0
    D = True
    while c < len(x) and c < len(y):
        if x[c] < y[c]:
            break
        elif x[c] == y[c]:
            c += 1
        elif x[c] > y[c]:
            D = False
            break
        if len(x) >= len(y) and c == len(y)-1 and x[c] >= y[c]:
            D = False


    return D

Result = XY(S, T)

if Result:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s,t = map(str, [input() for i in range(2)])

S = [s[i] for i in range(len(s))]
T = [t[i] for i in range(len(t))]


def XY(x, y):
    x.sort()                   # 一番弱く
    y.sort(reverse=True)       # 一番強く
    c = 0
    D = True
    while c < len(x) and c < len(y):
        if x[c] < y[c]:
            break
        elif x[c] == y[c]:
            c += 1
        elif x[c] > y[c]:
            D = False
            break
        if len(x) >= len(y) and c == len(y)-1 and x[c] >= y[c]:
            D = False


    return D

Result = XY(S, T)

if Result:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
print('NYoe s'[list(input())<sorted(input())[::-1]::2])

Submission status: Wrong Answer

Solution code:
s=sorted(list(input()))
t=sorted(list(input()),reverse=True)
s2=""
t2=""
for x in s:
    s2+=x
for y in t:
    t2+=y
c=sorted([s2,t2])
if c[0]==s2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t).reverse()
for i in range(len(s_)):
    if not s_[i]<t[i]:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t)
for i in range(len(s_)):
    if not s_[i]<t[i]:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
print('NYoe s'[sorted(input())<list(input())::2])

Submission status: Wrong Answer

Solution code:
s=sorted;print("NYoe s"[s(input())>s(input())[::-1]::2])

Submission status: Wrong Answer

Solution code:
s=sorted;print("YNeos"[s(input())>s(input())[::-1]::2])

Submission status: Wrong Answer

Solution code:
ss = list(input())
tt = list(input())

hit=False
for s in ss:
    for t in tt:
        if s<t:
            hit=True
            break
    if hit:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = [i for i in input()]
s.sort(reverse = True)
s ="".join(s)
t = [i for i in input()]
t.sort(reverse = True)
t ="".join(t)

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ok=False
snum=[]
tnum=[]
for i in range(len(s)):
    snum.append(ord(s[i]))
for i in range(len(t)):
    tnum.append(ord(t[i]))
tnum.sort(reverse=True)
if len(s)>=len(t):
    round=len(t)
else:
    round=len(s)
for i in range(round):
    if (snum[i]<tnum[i]) or (snum==tnum[:round]and len(t)>len(s)):
        ok=True
        break
print("Yes"if ok else"No")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ok=False
snum=[]
tnum=[]
for i in range(len(s)):
    snum.append(ord(s[i]))
snum.sort()
for i in range(len(t)):
    tnum.append(ord(t[i]))
tnum.sort(reverse=True)
if len(s)>=len(t):
    round=len(t)
else:
    round=len(s)
for i in range(round):
    if (snum[i]<tnum[i]) or (snum==tnum[::len(s)+1]and len(t)>len(s)):
        ok=True
        break
print("Yes"if ok else"No")

Submission status: Wrong Answer

Solution code:
str_s = input()
str_t = input()

str_s_d = sorted(str_s)
str_t_d = sorted(str_t, reverse=True)

print(str_s_d)
print(str_t_d)

if str_s_d < str_t_d:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
S_list = []
for i in range(len(S)) :
    S_list.append(S[i:i+1])
    S_list.sort()
T = input()
T_list = []
for i in range(len(T)) :
    T_list.append(T[i:i+1])
    T_list.sort()

if len(S_list)<len(T_list) :
    if S_list == T_list[:len(S_list) - 1] :
        print("Yes")
    else:
        print("No")
else:
    for i in range(len(T_list)) :
        if S_list[:i+1] == T_list[:i+1] :
            if S_list[:i+2]<T_list[:i+2] :
                print("Yes")
                break
        else :
            print("No")
            break

Submission status: Wrong Answer

Solution code:
a,b = input(),input()
print("No" if a>=b else "Yes")

Submission status: Wrong Answer

Solution code:
a,b = input(),input()
print("Yes" if a<b else "No")

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
sl = [c for c in S]
tl = [c for c in T]
sl.sort()
tl.sort()
print("Yes" if sl[0] < [c for c in reversed(tl)][0] else "No")

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
sl = [c for c in S]
tl = [c for c in T]
sl.sort()
tl.sort()
print("YES" if sl[0] < [c for c in reversed(tl)][0] else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = sorted(list(input()))
T = sorted(list(input()))[::-1]
s = ""
t = ""
for x in S:
    s += x
for x in T:
    t += x
compare_place = sorted([s,t])
if compare_place[0] == s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
subset = True
ans = ""
for i in range(min(len(s),len(t))):
    s_n = s.pop(s.index(min(s)))
    t_n = t.pop(t.index(max(t)))
    if s_n != t_n:
        subset = False
        if s_n < t_n:
            ans = "Yes"
        else:
            ans = "No"
        break
if subset == True:
    if len(s_n) < len(t_n):
        ans = "Yes"
    else:
        ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
a=[i for i in input()]
b=[i for i in input()]
a=sorted(a)
b=sorted(b)
b=b[::-1]
#print(a)
#print(b)
aa=set(a)
bb=set(b)
if aa==bb and len(b)<=len(a):
	print("No")
elif aa==bb and len(b)>len(a):
	print("Yes")
else:
	hantei=True
	if len(a)<=len(b):
		for i in range(len(a)):
			if a[i]>b[i]:
				hantei=False
				print("ha")
				break
			elif a[i]<b[i]:
				hantei=True
				print("haa")
				break
	else:
		hantei=False
		for i in range(len(b)):
			if a[i]>b[i]:
				hantei=False
				print("haaa")
				break
			elif a[i]<b[i]:
				hantei=True
				print("haaaa")
				break
	if hantei == True:
		print("Yes")
	else:
		print("No")

Submission status: Wrong Answer

Solution code:
a=[i for i in input()]
b=[i for i in input()]
a=sorted(a)
b=sorted(b)
b=b[::-1]
print(a)
print(b)
aa=set(a)
bb=set(b)
if aa==bb and len(b)<=len(a):
	print("No")
elif aa==bb and len(b)>len(a):
	print("Yes")
else:
	hantei=True
	if len(a)<=len(b):
		for i in range(len(a)):
			if a[i]>b[i]:
				hantei=False
				print("ha")
				break
			elif a[i]<b[i]:
				hantei=True
				print("haa")
				break
	else:
		hantei=False
		for i in range(len(b)):
			if a[i]>b[i]:
				hantei=False
				print("haaa")
				break
			elif a[i]<b[i]:
				hantei=True
				print("haaaa")
				break
	if hantei == True:
		print("Yes")
	else:
		print("No")

Submission status: Wrong Answer

Solution code:
s_list = list(input())
t_list = list(input())
s_list.sort()
t_list.sort(reverse=True)
if str(s_list)<str(t_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
A = []
B = []
for i in s:
    A.append(ord(i))
for j in t:
    B.append(ord(j))

if(min(A)<max(B)):
    print("Yes")
else:
    if(len(s)<len(t) and min(A)==min(B)):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
len_S = len(S)
len_T = len(T)
mini = min(len_S, len_T)
if(len_S < len_T):
  for i in range(len_S):
    if(S[i] == T[i]):
      print('Yes')
      break
  else:
    print('No')
elif(mini != max(len_S, len_T)):
  for i in range(mini):
    if(S[i] <= T[i]):
      print('Yes')
      break
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def main():
    s = input()
    t = input()

    s_bytes = sorted(s.encode())
    t_bytes = sorted(t.encode(), reverse = True)

    s_len = len(s)
    t_len = len(t)

    gt = s_len < t_len

    for i in range(len(s_bytes)):
        if t_len <= i:
            gt = False
            break
        if s_bytes[i] < t_bytes[i]:
            gt = True
            break

    print('Yes' if gt else 'No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input().strip()
t = input().strip()

s = ''.join(sorted(s))
t = ''.join(sorted(s)[::-1])

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

Submission status: Wrong Answer

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

s2 = ''.join(sorted(s))
t2 = ''.join(sorted(t,reverse=True))
print([s2,t2])
if (s2 < t2) :
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
s = raw_input().split()[0]
t = raw_input().split()[0]

s1 = list(s)
t1 = list(t)

s1.sort
t1.sort(reverse=True)

if s1<t1:
  print 'Yes'
else:
  print 'No'

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
slist=[]
tlist=[]
for i in range(len(s)):
    slist.append(s[i])
for i in range(len(t)):
    tlist.append(t[i])
slist.reverse()
tlist.reverse()


sw=''
tw=''
for i in range(len(s)):
    sw=sw+slist[i]    
for i in range(len(t)):
    tw=tw+tlist[i]    

if sw<tw:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
_s = ''.join(list(sorted(s)))
_t = ''.join(list(reversed(t)))
if _s < _t:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
def judge(l1,l2): # l1 (= l2
    for e in l1:
        if e not in l2:
            return False
            break
        elif e  == l1[-1]:
            return True
if len(s) < len(t) and judge(s,t):
    print("Yes")
elif len(s) > len(t) and judge(t,s):
    print("Yes")
else:
    s_ord = [ord(e) for e in s]
    t_ord = [ord(e) for e in t]
    s_ord.sort()
    t_ord.sort()
    t_ord.reverse()
    for i in range(min(len(t_ord),len(s_ord))):
        if t_ord[i] > s_ord[i]:
            print("Yes")
            break
        elif i == min(len(t_ord),len(s_ord)) - 1:
            print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
def judge(l1,l2): # l1 (= l2
    for e in l1:
        if e not in l2:
            return False
            break
        elif e  == l1[-1]:
            return True
if len(s) < len(t) and judge(s,t):
    print("Yes")
    exit()
elif len(s) > len(t) and judge(t,s):
    print("Yes")
    exit()
s_ord = [ord(e) for e in s]
t_ord = [ord(e) for e in t]
if max(t_ord) > min(s_ord):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)



#print(len(S))
#print(s)
i=0
a=False
for wer in range( len(S) ):
    if S[i]<=T[i]:
        a=True
        break
    i+=1
    #if S[i] is None:
     #   break

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)


#print(len(S))
#print(s)
i=0
a=False
for wer in range(100):
    if S[i]<T[i]:
        a=True
        break
i+=1
    #if S[i+1] is None:break

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)



#print(len(S))
#print(s)
i=0
a=False
for wer in range(100):
    if S[i]<T[i]:
        a=True
        break
    #if S[i+1] is None:break

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=list(s)
T=list(t)
S.sort()
T.sort()
T.reverse()
s=str(S)
t=str(T)
for char in S:
    print(char,end="")
print()
for char in T:
    print(char,end="")
print()


#print(len(S))
#print(s)
i=0
a=False
for wer in range(100):
    if S[i]<T[i]:
        a=True
        break
    #if S[i+1] is None:break

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

Submission status: Wrong Answer

Solution code:
import sys
N = list(input())
M = list(input())

N.sort()
M.sort(reverse = True)

if(len(N) < len(M)):
    for i in range(len(N)):
        if(M[i] > N[i]):
            print("YES")
            sys.exit()
        elif(M[i] == N[i]):
            continue
        else:
            print("NO")
            sys.exit()
    print("YES")

if(len(N) >= len(M)):
    for i in range(len(M)):
        if(M[i] > N[i]):
            print("YES")
            sys.exit()
        elif(M[i] == N[i]):
            continue
        else:
            print("NO")
            sys.exit()
    print("NO")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
t = t[::-1]
v = [s,t]
u = [s,t]
u.sort()
if u == v:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = sorted(s)
S = "".join(s)

t = sorted(t)
t = t[::-1]
T = "".join(t)

L = [S, T]

LL = sorted(L)
if LL[0] == S:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from itertools import zip_longest

s = input()
t = input()

s_ = sorted(list(s))
t_ = sorted(list(t))
st_ = sorted([s_, t_])

if s_ == t_:
    print("No")
elif st_[0] == s_:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s_arr=[]
t_arr=[]
for x in s:
    s_arr.append(ord(x)-ord('a'))
for x in t:
    t_arr.append(ord(x)-ord('a'))
s_arr=sorted(s_arr)
t_arr=sorted(t_arr)
t_arr.reverse()
if len(s_arr)>len(t_arr):
    t_arr+=[ord('a')-1]*(len(s_arr)-len(t_arr))
elif len(s_arr)<len(t_arr):
    s_arr+=[ord('a')-1]*(len(t_arr)-len(s_arr))
ans='No'
for i in range(len(s_arr)):
    if s_arr[i]<t_arr[i]:
        ans='Yes'
        break
    elif s_arr[i]>t_arr[i]:
        ans='No'
        break
    else:
        pass
print(ans)

Submission status: Wrong Answer

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

s_arr=[]
t_arr=[]
for x in s:
    s_arr.append(ord(x)-ord('a'))
for x in t:
    t_arr.append(ord(x)-ord('a'))
s_arr=sorted(s_arr)
t_arr=sorted(t_arr)
t_arr.reverse()
if len(s_arr)>len(t_arr):
    t_arr+=[ord('a')-1]*(len(s_arr)-len(t_arr))
ans='No'
for i in range(len(s_arr)):
    if s_arr[i]<t_arr[i]:
        ans='Yes'
        break
    elif s_arr[i]>t_arr[i]:
        ans='No'
        break
    else:
        pass
print(ans)

Submission status: Wrong Answer

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

s_arr=[]
t_arr=[]
for x in s:
    s_arr.append(ord(x)-ord('a'))
for x in t:
    t_arr.append(ord(x)-ord('a'))
s_arr=sorted(s_arr)
t_arr=sorted(t_arr)
t_arr.reverse()
if len(s_arr)>len(t_arr):
    t_arr+=[ord('a')-1]*(len(s_arr)-len(t_arr))
ans='Yes'
for i in range(len(s_arr)):
    if s_arr[i]<t_arr[i]:
        break
    elif s_arr[i]>t_arr[i]:
        ans='No'
    else:
        continue
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()

S = sorted(S)
tmp = ['','']
for s in S:
    tmp[0] += s
for t in T[::-1]:
    tmp[1] += t
if tmp[0] == tmp[1]:
    print('No')
    exit()
tmp2 = sorted(tmp)
if tmp2 == tmp:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s.sort()
t.sort()
print("Yes" if "".join(s) < "".join(t) else "No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
s1= sorted(s)
t1 = sorted(t)
if s1 < t1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
a = b = []
for i in range(len(s)):
  a.append(ord(s[i]))
for i in range(len(t)):
  b.append(ord(t[i]))
if min(a) < max(b):
  print("Yes")
  exit()
elif len(s) < len(t):
  for i in range(len(s)):
    if s[i] != t[i]:
      print("No")
      exit()
  print("Yes")
  exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
t = list(input())
a = b = []
for i in range(len(s)):
  a.append(ord(s[i]))
for i in range(len(t)):
  b.append(ord(t[i]))
if min(a) < max(b):
  print("Yes")
elif len(s) < len(t):
  for i in range(len(s)):
    if s[i] != t[i]:
      print("No")
      exit()
  print("Yes")
  exit()
print("No")

Submission status: Wrong Answer

Solution code:
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=sorted([S,T])

if T==S:
  print('No')
else:
  if L[0]==S:
     print('Yes')
  else:
     print('No')

Submission status: Wrong Answer

Solution code:
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
else:
  if L[0]==S:
     print('Yes')
  else:
     print('No')

Submission status: Wrong Answer

Solution code:
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
elif L[0]==S:
  print('Yes')
elif L[0]==T:
  print('No')

Submission status: Wrong Answer

Solution code:
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T<S:
  print('No')
else:
  print('Yes')