using System.Linq; using System.Collections.Generic; using System; public class P { public int id { get; set; } public int a { get; set; } public int b { get; set; } public int c { get; set; } } public class Hello { public static void Main() { var ps = new List

(); for (int i = 0; i < 2; i++) { string[] line = Console.ReadLine().Trim().Split('.'); var a = int.Parse(line[0]); var b = int.Parse(line[1]); var c = int.Parse(line[2]); ps.Add(new P { a = a, b = b, c = c ,id = i}); } var id = ps.OrderBy(x => x.a).ThenBy(x => x.b).ThenBy(x => x.c).First().id; Console.WriteLine(id == 0? "NO":"YES"); } }