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:
s=input()
t=input()

s=sorted([x for x in s],reverse=True)
t=sorted([x for x in t],reverse=True)

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

Submission status: Wrong Answer

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

s = input()
t = input()
if s == t:
    print('No')
    exit()
ss = sorted(s, reverse=True)
tt = sorted(t, reverse=True)
sss = ''.join(ss)
ttt = ''.join(tt)
if max(sss, ttt) == ttt:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    s = list(input())
    t = list(input())

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

    index = 0
    while True:
        if index > len(s) - 1 or index > len(t) - 1:
            print('No')
            exit()
        if ord(s[index]) < ord(t[index]):
            print('Yes')
            exit()
        index += 1
        if index == min([len(s), len(t)]) and len(s) < len(t):
            print('Yes')
            exit()

Submission status: Wrong Answer

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

s2="".join(sorted(s,reverse=False))
t2="".join(sorted(t,reverse=True))

if s < t:
  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> t:
    print("No")

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss==tt:
            len_s+=1
            if len_s==len(s):
                print("No")
                exit()
        elif ss < tt: 
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss==tt:
            len_s+=1
            if len_s==len(s):
                print("No")
                exit()
        elif ss < tt: 
           print("Yes")
           exit()

print("No")


#s==t and len_s<len_t :YES,else:NO 
#

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss==tt:
            if len_s==len(s):
                print("No")
                exit()
        elif ss < tt: 
           print("Yes")
           exit()
           
print("No")

Submission status: Wrong Answer

Solution code:


#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss==tt:
            continue

        elif ss < tt: 
           print("Yes")
           exit()

print("No")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss==tt:
            continue

        elif ss < tt: 
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss <= tt: 
            len_s+=1
            
            if len_s == len(s):
                print("Yes")
                exit()

print("No")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

len_s=0
for ss in s:
    for tt in t :
        if ss < tt: 
            len_s+=1
            
            if len_s == len(s):
                print("Yes")
                exit()

print("No")

Submission status: Wrong Answer

Solution code:

#t 小さい, s 大きい
# tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

for ss in s:
    for tt in t :
        if ss < tt: 
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:

#tの最小 (昇順), sの最大(降順)ソート

s=input()
t=input()

s=sorted(s)
t=sorted(t,reverse=True)
#s=xy, t=yxa

if t[0:len(s)+1] == s:
    if len(t)>len(s):
        print("Yes")
        exit()
    else:
        print("No")
        exit()

for ss in s:
    for tt in t :
        if ss <= tt: 
            print("Yes")
            exit()

print("No")

Submission status: Wrong Answer

Solution code:
class Judge():
    @classmethod
    def judge1(cls,s,t):
        if len(s) == len(t):
            return False
        judge = True
        n = min(len(s),len(t))
        for i in range(n):
            judge = judge and s[i]==t[i]
        return judge

    @classmethod
    def judge2(cls,s,t):
        n = min(len(s),len(t))
        for l in range(1,n):
            judge = True
            for i in range(l-1):
                judge = judge and s[i]==t[i]
            judge = judge and s[l] < t[l]
            if judge == True:
                break

        return judge

s = list(input())
s.sort()
t = list(input())
t.sort()

judge = Judge.judge1(s,t) or Judge.judge2(s,t)

if judge:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
print("Yes") if sorted(input()) < sorted(input()) else print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ans=["Yes","No"]

s=sorted(s)
t=sorted(t)
flg=0

if len(s)<len(t):
    for i in s:
        if i not in t:
            flg=1
            break
else:
    bcount=0
    for i in range(len(t)):
        if t[i]>s[i]:
            bcount+=1
    if bcount==0:
        flg=1

print(ans[flg])

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
S = []
T = []
for i in s:
    S.append(ord(i))
S.sort()
for i in t:
    T.append(ord(i))
T = sorted(T,reverse=True)
ans = "Yes"
for k in range(min(len(s),len(t))):
    if S[k]==T[k]:
        continue
    elif S[k]<T[k]:
        ans = "Yes"
        break
    elif S[k]>T[k]:
        ans ="No"
        break
if s == t:
    ans ="No"
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    [s,t]=[str(input()) for i in range(2)]

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

resolve()

Submission status: Wrong Answer

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

s_, t_ = ''.join(sorted(s)), ''.join(sorted(t))
if s_ > t_:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
s=[str(a) for a in S]
t=[str(b) for b in T]
s.sort()
t.sort(reverse=True)
s=''.join(s)
t=''.join(t)
if s[0]<t[0]:
  print ("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
s=[str(a) for a in S]
t=[str(b) for b in T]
s.sort()
t.sort(reverse=True)
s=''.join(s)
t=''.join(t)
print(s)
if s[0]<t[0]:
  print ("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

length = min(len(s), len(t))

while i <= length-1:
    if s[i] == t[i]:
        i += 1
    elif s[i] < t[i]:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

print('Yes' if length == len(s) else 'No')

Submission status: Wrong Answer

Solution code:
#82B two anagrams
s=list(input())
t=list(input())
length=len(s)
len2=len(t)
for j in range(length):
    for i in range(0,length-j-1):
        if s[i]>s[i+1]:
            temp=s[i+1]
            s[i+1]=s[i]
            s[i]=temp
for j in range(len2):
    for i in range(0,len2-j-1):
        if t[i]<t[i+1]:
            temp=t[i+1]
            t[i+1]=t[i]
            t[i]=temp     
sd="".join(s)
td="".join(t)
# print(sd,td)

if sd<td:
    print("TRUE")
else:
    print("FALSE")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print('yes' if sorted(input()) < sorted(input(), reverse=True) else 'No')

Submission status: Wrong Answer

Solution code:
#n = int(input())
s = input()
t = input()
#a_L = list(map(int,input().split()))

s_L = list(s)
t_L = list(t)

s_L = sorted(s_L)
t_L = sorted(t_L,reverse=True)

tmp = ["".join(s_L),"".join(t_L)]
tmp = sorted(tmp,reverse=True)

if tmp[0] == "".join(t_L):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#n = int(input())
s = input()
t = input()
#a_L = list(map(int,input().split()))

s_L = list(s)
t_L = list(t)

s_L = sorted(s_L)
t_L = sorted(t_L,reverse=True)

tmp = ["".join(s_L),"".join(t_L)]
#print(sorted(tmp))
tmp = sorted(tmp)
if tmp[0] == "".join(s_L):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#n = int(input())
s = input()
t = input()
#a_L = list(map(int,input().split()))

s_L = list(s)
t_L = list(t)

s_L = sorted(s_L)
t_L = sorted(t_L,reverse=True)

tmp = ["".join(s_L),"".join(t_L)]
#print(sorted(tmp))
tmp = sorted(tmp,reverse=True)
if tmp[0] == "".join(t_L):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
s = sorted(list(str(input())))
t = sorted(list(str(input())), reverse = True)
u = min(len(s), len(t))
for i in range(min(len(s), len(t))):
    if s[i] < t[i]:
        print('Yes')
        sys.exit()
    if s[i] > t[i]:
        print('No')
        sys.exit()
    elif len(s) < len(t):
        print('Yes')
        sys.exit()
    elif len(s) >= len(t):
        print('No')
        sys.exit()

Submission status: Wrong Answer

Solution code:
s = sorted(list(str(input())))
t = sorted(list(str(input())), reverse = True)
x = 0
for i in range(len(s)):
    if s[i] < t[i]:
        print('Yes')
        break
    if s[i] == t[i]:
        x += 1
    if x == len(s) and len(s) < len(t):
        print('Yes')
    else:
        print('No')
        break

Submission status: Wrong Answer

Solution code:
s = input().rstrip('\r')
t = input().rstrip('\r')
s = "".join(sorted(s))
t = "".join(sorted(t))
if s < t:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

def Two_Anagrams(s , t):

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

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

    print(not ans)
    if not ans and len(s) >= len(t):
        ans = "No"
    elif not ans:
        ans = "Yes"

    return ans

def main():
    s = list(str(input()))
    t = list(str(input()))
    print(Two_Anagrams(s , t))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def Two_Anagrams(s , t):

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

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

    return ans

def main():
    s = list(str(input()))
    t = list(str(input()))
    print(Two_Anagrams(s , t))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def Two_Anagrams(s , t):

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

    for i in range(min(len(s) , len(t))):
        if s[i] > t[i]:
            ans = "No"
            break
        elif s[i] < t[i]:
            ans = "Yes"
            break
    
    if ans == "" and len(s) >= len(t):
        ans = "No"

    return ans

def main():
    s = list(str(input()))
    t = list(str(input()))
    print(Two_Anagrams(s , t))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

ans = ["No", "Yes"]

# print(s)

flag = 0
for i in range(min(len(s), len(t))):
    if (s[i] < t[i]):
        flag = 1
        break

print(ans[flag])

Submission status: Wrong Answer

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

min_len = min(len(s),len(t))

ans = False

for i in range(min_len):
    if s[i] < t[i]:
        ans = True
        break
        
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = sorted(list(input()))
t = sorted(list(input()))

str_long = min([len(s), len(t)])

i = 0
while i < str_long:
    if ord(s[i]) == ord(t[-1-i]):
        i += 1
        continue
    elif ord(s[i]) < ord(t[-i-1]):
        print("Yes")
        sys.exit()
    else:
        break
print("No")

Submission status: Wrong Answer

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

s = sorted(s)
s = ''.join(s)
t = sorted(t, reverse=1)
t = ''.join(t)
l = [s,t]
k = sorted(l)
if l==k:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=sorted(str(input()))
t=sorted(str(input()))
t.reverse()
print(s,t)
l=[s,t]
lis=sorted(l)
if s==t:
  print('No')
else:
  if l==lis:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if s < t: 
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    s = "".join(sorted(input()))
    t = "".join(sorted(input()))
    if len(s) < len(t) and s in t:
        print("Yes")
    else:
        for i in range(min(len(s), len(t))):
            if s[-i] < t[-i]:
                print("Yes")
                break
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slist = [ord(i) for i in s]
tlist = [ord(i) for i in t]
slist.sort()
tlist.sort(reverse=True)

lim=0
if len(s)>len(t):lim = len(t)
else:lim = len(s)

for i in range(lim):
  if slist[i]<tlist[i]:
    print("Yes")
    exit()
if len(t)>len(s):
  print("Yes")
  exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = sorted(input())
t = sorted(input(), reverse=True)
alf = 'abcdefghijklmnopqrstuvwxyz'
r = 'No'
if len(s)<len(t) and s==t[len(s):]:
    r = 'Yes'

for i in range(min(len(s),len(t))):
    si = alf.index(s[i])
    ti = alf.index(t[i])
    if si < ti:
        r = 'Yes'
        break
    elif si == ti:
        continue
    else:
        break
print(r)

Submission status: Wrong Answer

Solution code:
S = sorted(input())
T = reversed(sorted(input()))
x = ord(S[-1])
for t in T:
    if ord(t) >= x:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
S = sorted(input())
T = input()
x = ord(S[-1])
for t in T:
    if ord(t) >= x:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
s = sorted(s)
t = sorted(t, reverse=True)
u = min(len(s), len(t))
if s == t:
    print("No")
    exit()
if len(s) < len(t) and s == t[:len(s)]:
    print("Yes")
    exit()
else:
    for i in range(u):
        if s[i] > t[i]:
            print("No")
            exit()
        elif s[i] == t[i]:
            pass
        else:
            print("Yes")
            exit()

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

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

ans = "Yes"
if s == t:
    ans = "No"
else:
    for i in range(len(s)):
        if i == len(t):
            break
        elif s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            break
        else:
            ans = "No"
            break

print(ans)

Submission status: Wrong Answer

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

ans = "Yes"
if s == t:
    ans = "No"
elif len(s) > len(t):
    ans = "No"
else:
    for i in range(len(s)):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            break
        else:
            ans = "No"
            break

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

def solve(s, t):
    sc = sorted(Counter(s).keys())
    tc = sorted(Counter(t).keys(), reverse=True)
    for a, b in zip(sc, tc):
        if a < b:
            return 'Yes'
        if a > b:
            return 'No'
    return 'Yes' if len(s) < len(t) else 'No'

_s = input()
_t = input()
print(solve(_s, _t))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
t.sort(reverse=True)
t=''.join(t)
s.sort()
s=''.join(s)
dic=[s,t]
dic.sort()
if dic[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()))
t = sorted(list(input()),reverse = True)
print(s)
print(t)
 
if str(s) < str(t):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = sorted(input())
t = sorted(input())
N = len(s)
M = len(t)
ans = "No"

if N < M:
  ans = "Yes"
  for i in range(N):
    if s[i] not in t:
      ans = "No"

for i in range(min(N, M)):
  if s[i] < t[i]:
    ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
s = sorted(input())
t = sorted(input())
N = len(s)
M = len(t)
ans = "No"

if N < M and s[0:N] == t[0:N]:
  ans = "Yes"

for i in range(min(N, M)):
  if s[i] < t[i]:
    ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
try:
    s = input()
    t = input()
    s_ = sorted(s)
    t_ = sorted(t, reverse=True)
    print(s_)
    print(t_)
    print('Yes' if s_<t_ else 'No')
except EOFError:
    pass

Submission status: Wrong Answer

Solution code:
try:
    s = input()
    t = input()
    s_ = sorted(s)
    t_ = sorted(t, reverse=True)
    print(s_)
    print(t_)
    print('No' if s_>t_ else 'Yes')
except EOFError:
    pass

Submission status: Wrong Answer

Solution code:
rev_s = "".join(sorted(input(),reverse=True))
rev_t = "".join(sorted(input(),reverse=True))
# print(rev_s)
# print(rev_t)
if rev_t > rev_s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = "yx"
s2 = sorted(s)

t = "axy"
t2 = sorted(t, reverse=True)

for (i,j) in zip(s2,t2):
    if s == t:
        print("Yes")
        break
    if i < j:
        print("yes")
        break
    else:
        print("no")
        break

Submission status: Wrong Answer

Solution code:
s = input()
s2 = sorted(s)

t = input()
t2 = sorted(t, reverse=True)

for (i,j) in zip(s2,t2):
    if s == t:
        print("Yes")
        break
    if i < j:
        print("yes")
        break
    else:
        print("no")
        break

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()
s3 = sorted(s2)

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

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()

ans = 0
ans2 = 0
ans3 = 0




for i in s2:
    if s == s2:
        break
    if len(set(s)) == len(set(s1)) and s[0] == s2[0]:
        ans3 = ans3 + 1
        if ans3 == 1:
            break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if (ans != 0 and ans2 != 0) or ans3 == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()

ans = 0
ans2 = 0
ans3 = 0




for i in s2:
    if s == s2:
        break
    if len(set(s)) == len(set(s1)) and s[0] == s2[0]:
        ans3 = ans3 + 1
        if ans3 == 1:
            break
    if s1[0] < i:
        ans = ans + 1
        for k in range(1,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if (ans != 0 and ans2 != 0) or ans3 == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()

ans = 0
ans2 = 0
ans3 = 0




for i in s2:
    if s == s2:
        break
    if len(set(s)) == len(set(s1)) and s[0] == s2[0]:
        ans3 = ans3 + 1
        if ans3 == 1:
            break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if (ans != 0 and ans2 != 0) or ans3 == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()



ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] <= i:
                ans2 = ans2 + 1
    elif s1[0] == i:
        ans = ans + 1
        for j in range(0,len(s1)):
            if s1[j] <= i:
                ans2 = ans2 + 1

if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s=='w' and s2=='ww':
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if s=='w' and s2=='w':
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

print(['No', 'Yes'][sorted(s1) < sorted(s2)])

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()


ans = 0
ans2 = 0



for i in s2:
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()


ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = "cd"
s1 = sorted(s)
s2 = "abc"


ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1
    
if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()


ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] < i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] < i:
                ans2 = ans2 + 1

if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = sorted(s)
s2 = input()


ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] <= i:
        ans = ans + 1
        for k in range(0,len(s1)):
            if s1[k] <= i:
                ans2 = ans2 + 1
    
if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=[i for i in input()]
t=[i for i in input()]
s1="".join(sorted(s)[::-1])
t1="".join(sorted(t)[::-1])
if s1>=t1:print("No")
else:print("Yes")

Submission status: Wrong Answer

Solution code:
s = "w"
s1 = sorted("w")
s2 = "ww"

ans = 0
ans2 = 0



for i in s2:
    if s == s2:
        break
    if s1[0] <= i:
        ans = ans + 1
        for k in range(1,len(s1)):
            if s1[k] <= i:
                ans2 = ans2 + 1
    
if ans != 0 and ans2 != 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i, j in zip(s, t):
  if i < j:
    print("Yes")
    break
else:
  if len(s) < len(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)

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

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
equal = True
for i in range(short):
    if(s[i] < t[i] and equal == True):
        flag = True
        break
    elif(s[i] == t[i] and s < t):
        continue
    else:
        break

else:
    flag = True

if(s < t or flag):
    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)

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

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
equal = True
for i in range(short):
    if(s[i] < t[i]):
        flag = True
        break
    elif(s[i] == t[i] and equal == True):
        continue
    else:
        equal = False
        break

else:
    if(s_len < t_len and equal == True):
        flag = True

if(s < t or flag):
    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)

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

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
equal = True
for i in range(short):
    if(s[i] < t[i]):
        flag = True
        break
    elif(s[i] == t[i] and equal == True):
        continue
    else:
        equal = False

else:
    if(s_len < t_len and equal == True):
        flag = True

if(s < t or flag):
    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)

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

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
for i in range(short):
    if(s[i] < t[i]):
        flag = True
        break

else:
    if(s_len < t_len):
        flag = True

print(short)

if(s < t or flag):
    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)

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

if(s_len < t_len):
    short = s_len
else:
    short = t_len

flag = False
for i in range(short):
    if(s[i] < t[i]):
        flag = True

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