using System.Collections.Generic; using System; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { var s = Console.ReadLine(); var str = Console.ReadLine(); List list = new List(s.Length); List list2 = new List(str.Length); int x = 0 , tencount = 0; for (int i = 0; i < s.Length; i++) { list.Add(s[i]); } for (int j = 0; j < str.Length; j++) { list2.Add(str[j]); } for(int m = 0; m < s.Length; m++) { if (list[x] == list2[x]) { list.Remove(list[x]); list2.Remove(list2[x]); } else if(!(list[x] == list2[x])) { break; } } if (list.Count == 1 && list2.Count == 1 && int.Parse(list[0].ToString()) > int.Parse(list2[0].ToString())) { Console.WriteLine("YES"); } else if(list.Count == 1 && list2.Count == 1 && int.Parse(list[0].ToString()) < int.Parse(list2[0].ToString())) { Console.WriteLine("NO"); } else if (list.Count == 0 && list2.Count == 0) { Console.WriteLine("YES"); } else if (list.Count == 0 && list2.Count > 0) { Console.WriteLine("NO"); } else if (list.Count > 0 && list2.Count == 0) { Console.WriteLine("YES"); } else if(list[0].Equals(".")) { Console.WriteLine("YES"); } else if (list2[0].Equals(".")) { Console.WriteLine("NO"); } else if (list.IndexOf('.') > 0 && list2.IndexOf('.') == 0) { if (list.IndexOf('.') > list2.IndexOf('.')) { Console.WriteLine("YES"); } } else if (list.IndexOf('.') == 0 && list2.IndexOf('.') > 0) { if (list.IndexOf('.') < list2.IndexOf('.')) { Console.WriteLine("NO"); } } else if (!list[0].Equals(".") && !list2[0].Equals(".")) { if (int.Parse(list[0].ToString()) < int.Parse(list2[0].ToString())) { if (list.IndexOf('.') > list2.IndexOf('.')) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } else if (int.Parse(list[0].ToString()) > int.Parse(list2[0].ToString())) { if (list.IndexOf('.') < list2.IndexOf('.')) { Console.WriteLine("NO"); } else { Console.WriteLine("YES"); } } } } } }