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: Runtime Error

Solution code:
a = sorted(input(), reverse=True)
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
ans = 'No'
for i in range(len(aa)):
  if aa[i] == bb[i]: continue
  if aa[i] < bb[i]:
    ans = 'Yes'
    break
  else:
    ans = 'No'
    break
print(ans)

Submission status: Runtime Error

Solution code:
a = sorted(input(), reverse=True)
b = sorted(input(), reverse=True)
aa = ''.join(a)
bb = ''.join(b)
ans = 'Yes'
for i in range(len(aa)):
  if aa[i] == bb[i]: continue
  if aa[i] < bb[i]:
    break
  else:
    ans = 'No'
    break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

S = [ord(s) for s in S]
T = [ord(s) for s in T]

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

LS = len(S)
LT = len(T)

ok = False
for i in range(min(LS,LT)):
  s = S[i]
  t = T[i]
  if s < t:
    ok = True
    break
  elif s == t:
    continue
  else t < s:
    ok = False
    break

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s = list(input())
t = list(input())
s_uni = sorted([ord(i) for i in s])
t_uni = sorted([ord(i) for i in t], reverse = True)
for i in range(len(s)):
    if s_uni[i] < t_uni[i]:
        print('Yes')
        exit()
    elif s_uni[i] == t_uni[i]:
        continue
    else:
        print('No')
        exit()
if len(s) < len(t):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=input()
t=input()
s_=sorted(s,reverse=True)
t_=sorted(t)
A.append(s_)
A.append(t_)
B=sorted(A)
if B[0]=s_t:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
from collections import Counter
s = input()
t = input()
s_cnt = sorted(Counter(s).most_common())
t_cnt = sorted(Counter(t).most_common())[::-1]
s_replaced = ""
t_replaced = ""
for k, v in s_cnt:
    s_replaced += k * v 
for k, v in t_cnt:
    t_replaced += k * v 

def judge(s, t):
    for i in range(len(s)):
        if ord(s[i]) > ord(t[i]):
            return False
        if ord(s[i]) < ord(t[i]):
            return True
    if len(s) < len(t):
        return True
    else:
        return False

if judge(s_replaced, t_replaced):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    s =     _in[0]   # type:str
    t =     _in[1]   # type:str
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    s_arr = [_s for _s in s]
    t_arr = [_t for _t in t]
    s_arr.sort()
    t_arr.sort(reverse=True)
    s = ''.join(s_arr)
    t = ''.join(t_arr)
    if s==t:
        TF = 'Yes' if len(s)<len(t) else 'No'
    else:
        for i in range(min(len(s),len(t))):
            if s[i] != t[i]:
                TF = 'Yes' if s[i]<t[i] else 'No'
                break
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 
         'u', 'v', 'w', 'x', 'y', 'z']

for i in range(len(s)+1):
    if i == len(s):
        if len(t) > len(s):
            print('Yes')
        else:
            print('No')
    elif Alpha.index(s[i]) < Alpha.index(t[i]):
        print('Yes')
        break
    elif Alpha.index(s[i]) > Alpha.index(t[i]):
        print('No')
        break
    else:
        continue

Submission status: Runtime Error

Solution code:
s=''.join(sorted(input()))
t=''.joinsorted(input(),reverse=True))
print('YNeos'[s>=t::2])

Submission status: Runtime Error

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

S = ['a']*len(s)
T = ['a']*len(t)

for i in range (0, len(s)):
	S[i]=ord(s[i])

for i in range (0, len(t)):
	T[i]=ord(t[i])

S = sorted(S)
T = sorted(T, reverse=True)

check = 0

for i in range (0, len(s)):
	if S[i] < T[i]:
		print('Yes')
		exit()
	elif S[i] == T[i]:
		check+=1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
t = input()
letters_s = []
letters_t = []
for i in range(len(s)):
  letters_s.append(s[i])
letters_s.sort()
for i in range(len(t)):
  letters_t.append(len(t))
letters_t.sort(reverse=True)
ss = "".join(letters_s)
tt = "".join(letters_t)
if ss < tt:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    s = list(input())
    t = list(input())
    s = sorted(s)
    t = sorted(t)
    ind = 0
    for i in range(len(s)):
        if s[i] == t[i]:
            ind = i
    shrt = False
    for i in range(ind, len(t)):
        if s[0] < t[i]:
            shrt = True
            break
    if shrt :
        print("Yes")
    else:
        print("No")
main()

Submission status: Runtime Error

Solution code:
s = sorted(list(str(input())))
t = reversed(sorted(list(str(input())))
S = str()
T = str()
for i in s:
    S += i
for k in t:
    T += k
print('Yes' if S<T else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input().sorted()
t=input().sorted()
if a>b:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s=sorted(s)
t=sorted(t)
if a>b:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

for s_, t_ in zip(s,t):
	if s_ < t_ :
		print('Yes')
		sys.exit()

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

Submission status: Runtime Error

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

S = ''join(sorted(list(s)))
T = ''join(sorted(list(t),reverse=True))

print('Yes' if S<T else 'No')

Submission status: Runtime Error

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

a.sort()
b.sort(reverse=True)


for i in range(int(len(b))):
    c =(a[i],b[i])
    d = sorted(c)
    if i != int(len(b))-1:
        if a[i] == b[i]:
            continue
        elif c == d and a[i] != b[i]:
            print("No")
            break
        else:
            print("Yes")
            break
    if i == int(len(b))-1:
        if a[i] == b[i]:
            if int(len(a)) >= int(len(b)):
                print("No")
            else:
                print("Yes")
        elif c == d and a[i] != b[i]:
            print("No")
            break
        else:
            print("Yes")
            break

Submission status: Runtime Error

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

a.sort()
b.sort(reverse=True)


for i in range(int(len(b))):
    c =(a[i],b[i])
    d = sorted(c)
    if i != int(len(b))-1:
        if a[i] == b[i]:
            continue
        elif c == d and a[i] != b[i]:
            print("Yes")
            break
        else:
            print("No")
            break
    if i == int(len(b))-1:
        if a[i] == b[i]:
            if int(len(a)) >= int(len(b)):
                print("No")
            else:
                print("Yes")
        elif c == d and a[i] != b[i]:
            print("Yes")
            break
        else:
            print("No")
            break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
url = "https://atcoder.jp/contests/abc082/tasks/abc082_b"


def main():
    s1, s2 = [input() for i in range(2)]
    l1 = sorted(list(s1))
    l2 = sorted(list(s2), reverse=True)
    for i in range(len(l1)):
        if l1[i] < l2[i]:
            print('Yes')
            exit()
    if len(l1) < len(l2) and l1[-1] <= l2[-1]:
        print('Yes')
        exit()
    print('No')




if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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()
if len(s) < len(t):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s = input()
s.sort()
t= input()
t.sort()
t = ''.join(reversed(list(t)))

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

Submission status: Runtime Error

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

s1 = s.sort()
t1 = t.sort(reserve = True)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = sorted(list(str(input())))
t = sorted(list(str(input())), reverse = True)
x = 0
y = 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')
        break
    else:
        y += 1
if y == len(s):
    print('No')

Submission status: Runtime Error

Solution code:
S, T = [input() for _ in range(2)]

S = sorted(S)
T = sorted(T)
print(S,T)
flg = False
if len(S) < len(T):
  flg =True
      
if len(S) == len(T):
  for i in range(len(S)):
    if T[i] > s[i]:
      print("T>S")
      flg =True
    
if flg:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S, T = [input() for _ in range(2)]

S = sorted(S)
T = sorted(T)
print(S,T)
flg = False
if len(S) < len(T):
  for i, s in enumerate(S):
    print(T[i], s)
    if T[i] <= s:
      #print("T>S")      
      flg = True
      
if len(S) == len(T):
  for i, s in enumerate(S):
    if T[i] < s[i]:
      #print("T>S")
      flg =True
    
if flg:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

import sys
N = max(len(sorted_s),len(sorted_t))

for i in range(N):
    if ord(sorted_s[i]) < ord(sorted_t[i]):
        print('Yes')
        sys.exit()
    elif ord(sorted_s[i]) > ord(sorted_t[i]):
        print('No')
        sys.exit()

if len(sorted_s) < len(sorted_t):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

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

import sys
N = max(len(sorted_s),len(sorted_t))

for i in range(N):
    if ord(sorted_s[i]) < ord(sorted_t[i]):
        print('Yes')
        sys.exit()
    elif ord(sorted_s[i]) > ord(sorted_t[i]):
        print('No')
        sys.exit()

if ord(sorted_s[N-1]) == ord(sorted_t[N-1]):
    if len(sorted_s) < len(sorted_t):
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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(len(s)):
    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: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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 s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            break
        else:
            ans = "No"
            break

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
def qsort(array):
	if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]
        return qsort(less) + [pivot] + qsort(greater)
      
si = input()
ti = input()

s_sort = qsort(si)
t_sort = qsort(ti)

s = ''
t = ''

for i in s_sort:
    s += i
for i in t_sort[::-1]:
	t += i
if s < t:
	print('Yes')
else:
  	print('No')

Submission status: Runtime Error

Solution code:
a = list(input())
b = list(input())
a.sort()
b.sort(reverse = True)
if a < b:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s, t = readline().decode('utf8').split()
s.sort()
t.sort()
print('Yes' if s < t[::-1] else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
m = 0
if len(ss) <= len(ts):
  m = len(ss)
  l = 0
  for j in range(m):
    if alph.index(ss[j]) < alph.index(ts[j]):
      print("Yes")
      break
    elif alph.index(ss[j]) == alph.index(ts[j]) :
      if j == m -1:
        print("Yes")
      else:
        pass
    else:
      print("No")
      break
elif len(ss) == len(ts):
  m = len(ss)
  l = 0
  for j in range(m):
    if alph.index(ss[j]) < alph.index(ts[j]):
      print("Yes")
      break
    elif alph.index(ss[j]) == alph.index(ts[j]) :
      if j == m -1:
        print("No")
      else:
        pass
    else:
      print("No")
      break
else:
  m = len(ts)
  l = 0
  for j in range(m):
    if alph.index(ss[j]) < alph.index(ts[j]):
      print("Yes")
      break
    elif alph.index(ss[j]) == alph.index(ts[j]) :
      if j == m - 1:
        print("No")
    else:
      print("No")
      break

Submission status: Runtime Error

Solution code:
s = sorted(input())
z = sorted(input()), reverse=True
c=len(s) if len(s) <= len(z) else =len(z)
for a in range(c):
  if s[a] > z[a]:
    print('No')
    exit()
if len(s) == len(z):
  print('Yes')

Submission status: Runtime Error

Solution code:
s,t = list(input()),list(input())
s.sort()
t.sort(reverse=True)
count = 0
while count < len(s):
  if t[count] > s[count]:
    print("Yes")
    exit()
  else:
    count += 1
print("No")

Submission status: Runtime Error

Solution code:
s,t = list(input()),list(input())
s.sort()
t.sort(reverse=True)
count = 0
while count < len(s):
  if t[count] > s[0]:
    print("Yes")
    exit()
  else:
    count += 1
print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = sorted([char for char in input()])
t = sorted([char for char in input()]).reverse()
print("Yes" if s < t else "No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s.sort()
t.sort()

if s==t:
  print("No")
else:
  u=[s,t].sort()
  if u[0]==s:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

ss = sorted(s)
tt = sorted(t)

ans = "No"

for i in range(len(ss)):
  if ss[i] < tt[i]:
    ans = "Yes"
    break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
alpha2num = lambda c: ord(c) - ord("a")
if s == t:
    print("No")
    sys.exit()
for i in range(min(len(s), len(t))):
    x, y = s[i], t[j]
    if alpha2num(x) < alpha2num(y):
        print("Yes")
        sys.exit()
    elif alpha2num(x) > alpha2num(y):
        print("No")
        sys.exit()
if len(t) > len(s):
    print("Yes")

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
alpha2num = lambda c: ord(c) - ord("a")
if s == t:
    print("No")
    sys.exit()
for i in range(min(len(s), len(t))):
    if alpha2num(i) < alpha2num(j):
        print("Yes")
        sys.exit()
    elif alpha2num(i) > alpha2num(j):
        print("No")
        sys.exit()
if len(t) > len(s):
    print("Yes")

Submission status: Runtime Error

Solution code:
b

Submission status: Runtime Error

Solution code:
s=input().sort()
t=input().sort()
for x,y in s,t:
    if x>y:
        print("Yes")
   break
print("No")

Submission status: Runtime Error

Solution code:
s = sorted(input())
t = sorted(input(),reverse=True)
ans = ""
def check_dict():
  for i in range(len(s)):
    if s[i] < t[i]:
      ans = "Yes"
      return ans
    elif s[i] > t[i]:
      ans = "No"
      return ans
  return ""
if len(s) < len(t):
  ans = check_dict()
  if ans == "":
    ans = "Yes"
  print(ans)
else:
  ans = check_dict()
  if ans == "":
    ans = "No"
  print(ans)

Submission status: Runtime Error

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

s = sorted(s)
t = sorted(t)

# print(s,t)
if s == [] and t == []:
    print('No')
    exit()
elif s == []:
    print('Yes')
elif t == []:
    print('No')
    
if s[0] < t[-1]:
    print('Yes')
    exit()
elif s[0] > t[-1]:
    print('No')
    exit()
elif len(s) < len(x):
    print('Yes')
    exit()
else:
    print('No')

Submission status: Runtime Error

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

s = sorted(s)
t = sorted(t)

# print(s,t)

if s[0] < t[-1]:
    print('Yes')
    exit()
elif s[0] > t[-1]:
    print('No')
    exit()
elif len(s) < len(x):
    print('Yes')
    exit()
else:
    print('No')

Submission status: Runtime Error

Solution code:
s = str(input())
t = str(input())
S = []
T = []

for i in s:
    S.append(ord(i))
for j in t:
    T.append(ord(j))

S = sorted(S)
T = sorted(T, reverse=True)

ans = 'Yes'

for n in range(len(S)):
    if S[n] < T[n]:
        break
    elif S[n] == T[n]:
        continue
    else:
        ans = 'No'

if S == T:
    ans = 'No'

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import string
s=input()
t=input()
a=string.ascii_lowercase
cnt1=0
for i in range(len(s)):
  n = a.find(s[i])
  if cnt1 < n:
    cnt1 = n

cnt2=0
for i in range(len(t)):
  n = a.find(s[i])
  if cnt2 < n:
    cnt2 = n
if cnt1 < cnt2:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

len_s = len(sorted_s)
flag = 0
for i in range(len_s):
    s_i = sorted_s[i]
    t_i = sorted_t[i]
    if s_i < t_i:
        flag = 1
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

len_s = len(sorted_s)
flag = 0
for i in range(len_s):
    s_i = sorted_s[i]
    t_i = sorted_t[i]
    if s_i < t_i:
        flag = 1
        break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
len = min(len(S), len(T))

flg = 2

for i in range(len):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) < len(T):
		print("Yes")
	else:
		print("No")

Submission status: Runtime Error

Solution code:
S = sorted(list(map(str, input())))
T = sorted(list(map(str, input())), reverse = True)
len = min(len(S), len(T))

print(S, T)
flg = 2

for i in range(len):
	if S[i] < T[i]:
		flg = 1
		break
	elif S[i] > T[i]:
		flg = 0
		break

if flg == 1:		
	print("Yes")
elif flg == 0:
	print("No")
else:
	if len(S) <= len(T):
		print("Yes")
	else:
		print("No")

Submission status: Runtime Error

Solution code:
#
# abc082 b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


def resolve():
    s = list(input())
    t = list(input())

    flag = False
    s = sorted(s, reverse=True)
    t = sorted(t, reverse=True)
    for i in range(min(len(s), len(t)):
        if s[i] < t[i]:
            flag = True
            break
        elif s[i] == t[i] and len(s) < len(t):
            flag = True
            break

    if flag == True:
        print("Yes")
    else:
        print("No")


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """yx
axy"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """ratcode
atlas"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """cd
abc"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """w
ww"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """zzz
zzz"""
        output = """No"""
        self.assertIO(input, output)


if __name__ == "__main__":
    #unittest.main()
    resolve()

Submission status: Runtime Error

Solution code:
#
# abc082 b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


def resolve():
    s = list(input())
    t = list(input())

    flag = False
    s = sorted(s, reverse=True)
    t = sorted(t, reverse=True)
    for i in range(len(s)):
        if s[i] < t[i]:
            flag = True
            break
        elif s[i] == t[i] and len(s) < len(t):
            flag = True
            break

    if flag == True:
        print("Yes")
    else:
        print("No")


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """yx
axy"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """ratcode
atlas"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """cd
abc"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """w
ww"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """zzz
zzz"""
        output = """No"""
        self.assertIO(input, output)


if __name__ == "__main__":
    #unittest.main()
    resolve()

Submission status: Runtime Error

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

s.sort()
s=''.join(s)

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

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

Submission status: Runtime Error

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

s.sort()
s=''.join(s)

t.reverse()
t=''.join(t)

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

Submission status: Runtime Error

Solution code:
s = [*input()]
t = [*input()]
s.sort()
t.sort()
t.reverse()
print("Yes" if s < t else "No")

Submission status: Runtime Error

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

s.sort(reverse=True)
s_final = s[-1]
s_semifinal = s[-2]
s_len = len(s)
t.sort(reverse=True)
t_first = t[0]
t_second = t[1]
t_len = len(t)

alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
dic = dict(zip(alpha, num))

if dic[s_final] < dic[t_first]:
    print('Yes')
elif dic[s_final] == dic[t_first] and dic[s_semifinal] < dic[t_second]:
    print('Yes')
elif dic[s_final] == dic[t_first] and dic[s_semifinal] == dic[t_second] and s_len < t_len:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys

s = sorted(input())
t = sorted(input())[::-1]
for i in range(len(s)):
    if s[i] < t[i]:
        print("Yes")
        sys.exit()
    elif s[i] > t[i]:
        print("No")
        sys.exit()
if len(t) > len(s):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S = ''.join(sorted(input.strip()))
T = ''.join(sorted(input.strip(),reverse=True))
print('Yes' if S < T else 'No')

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

a=input()
b=input()

a=sorted(a)
b=sorted(b)

if a==b:
	print("No")
	sys.exit()

for i in range(min(len(a),len(b))):
	if a[i]<b[-(i+1)]:
		print("Yes")
		break
	
	elif a[i]==b[-(i+1)]:
		continue
		
	else:
		print("No")
		break
		
if len(a)<len(b)):
	print("Yes")
	
else:
	print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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