using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string N = Console.ReadLine(); string X = Console.ReadLine(); N = N.Replace(".", ""); X = X.Replace(".", ""); for (int i = 0; i < N.Length; i++) { int ver = int.Parse(N.Substring(i, 1)); int judge = int.Parse(X.Substring(i,1)); if (judge < ver) { Console.WriteLine("YES"); break; } else if (judge == ver) { continue; } else { Console.WriteLine("NO"); break; } } } } }