using System; using System.Linq; class Program { public void Solve() { int[] kaseki = Console.ReadLine().Split('.').Select(s => int.Parse(s)).ToArray(); int[] hikaku = Console.ReadLine().Split('.').Select(s => int.Parse(s)).ToArray(); if (kaseki[0] < hikaku[0] || (kaseki[0] == hikaku[0] && kaseki[1] < hikaku[1]) || (kaseki[0] == hikaku[0] && kaseki[1] == hikaku[1] && kaseki[2] < hikaku[2])) { Console.WriteLine("NO"); } else { Console.WriteLine("YES"); } } static void Main() { var solver = new Program(); solver.Solve(); } }