using System; namespace yukicoder00138CS { class Program { static void Main(string[] args) { var I = Console.ReadLine(); var O = I.Split('.'); var A = int.Parse(O[0]); var B = int.Parse(O[1]); var C = int.Parse(O[2]); var L = A * 10000 + B * 100 + C; I = Console.ReadLine(); O = I.Split('.'); A = int.Parse(O[0]); B = int.Parse(O[1]); C = int.Parse(O[2]); var T = A * 10000 + B * 100 + C; if (T <= L) Console.Write("YES"); else Console.Write("NO"); } } }