using System; class Program { static void Main(string[] args) { var fossil = Console.ReadLine(); var next = Console.ReadLine(); var result = (next.CompareTo(fossil) == -1) ? "YES" : "NO"; Console.WriteLine(result); } }