using System; public class Program { public static void Main() { int[] fossil = Array.ConvertAll(Console.ReadLine().Split('.'), value => int.Parse(value)); int[] obj = Array.ConvertAll(Console.ReadLine().Split('.'), value => int.Parse(value)); if (fossil[0] < obj[0]) { Console.WriteLine("NO"); return; } else if (fossil[0] > obj[0]) { Console.WriteLine("YES"); return; } else { if (fossil[1] < obj[1]) { Console.WriteLine("NO"); return; } else if (fossil[1] > obj[1]) { Console.WriteLine("YES"); return; } else { Console.WriteLine(fossil[2] >= obj[2] ? "YES" : "NO"); } } } }