s = input().split(".") p = input().split(".") S = int("".join(s)) P = int("".join(p)) if S > P: print("YES") else: print("NO")