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.

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`.

Examples

Input

yx
axy


Output

Yes


Input

ratcode
atlas


Output

Yes


Input

cd
abc


Output

No


Input

w
ww


Output

Yes


Input

zzz
zzz


Output

No
S = raw_input()
T = raw_input()

s_array = list(S)
t_array = list(T)

#print s_array, t_array

s_array.sort()
t_array.sort()
t_array.reverse()
#print s_array
#print t_array

result = 'both'

while len(s_array) > 0:
    item_s = s_array.pop(0)
    tmp_array = t_array[:]
    while len(tmp_array) > 0:
        item_t = tmp_array.pop(0)
#        print item_s, item_t
        if item_s < item_t:
            result = 'Yes'
            break
        elif item_s > item_t:
            result = 'No'
            break
        else:
            pass
    
    if result == 'Yes' or result == 'No':
        break

if result == 'Yes' or result == 'No':
    print result
else:
#    print len(S) , len(T)
    if len(S) < len(T):
        print 'Yes'
    else:
        print 'No'
