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.
s = sorted(input())
t = sorted(input())
print("Yes" if s<t else "No")
s = sorted(input())
t = sorted(input())[::-1]
print("Yes" if s<t else "No")