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(".", ""); int cnt = 0; 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) { cnt++; if(cnt==3) { Console.WriteLine("YES"); break; } } else { Console.WriteLine("NO"); break; } } } } }