For this Question: Given two strings S and T of the same length, you can rearrange the characters in S and T. Your task is to find if it is possible to rearrange S and T such that S is lexicographically smaller than T.The first line of input contains the string S. The next line of input contains the string T.

Constraints:-
1 <= |S| = |T| <= 100000

Note:- Both the string will contain only lowercase english letters.Print "YES" if it is possible to rearrange S and T such that S is lexicographically smaller than T else print "NO".Sample Input:-
school
newton

Sample Output:-
YES

Explanation:-
One of the possible rearrangements:- cshool < newton

Sample Input:-
efgh
abcd

Sample Output:-
NO, I have written this Solution Code: s = input()
t = input()
s = list(s)
t = list(t)
s = sorted(s)
t = sorted(t)
flag = 0
for i in range(len(s)):
    if s[i] < t[i]:
        flag =1
        break
    else:
        continue
if flag ==0:
    print("NO")
else:
    print("YES"), In this Programming Language: Python, Now tell me if this Code is compilable or not?