using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace yukicoder { class yc { static void Main() { string[] str1 = Console.ReadLine().Split('.'); string[] str2 = Console.ReadLine().Split('.'); int[] num1 = new int[3]; int[] num2 = new int[3]; bool end = false; for (int i = 0; i < 3; i++) { num1[i] = int.Parse(str1[i]); num2[i] = int.Parse(str2[i]); } if (num1[0] == num2[0] & num1[1] == num2[1] & num1[2] == num2[2]) { Console.WriteLine("YES"); end = true; } if (!end) { for (int i = 0; i < 3; i++) { if (num1[i] > num2[i]) { Console.WriteLine("YES"); break; } else if (num1[i] < num2[i]) { Console.WriteLine("NO"); break; } } } } } }