S = input() T = input() for i in range(min(len(S), len(T))): if S[i] < T[i]: print("Yes") break else: print("Yes" if len(S) < len(T) else "No")