using System; using System.Text; using System.Linq; namespace ConsoleApp11 { class Program { static void Main(string[] args) { int count = 0; string A = Console.ReadLine(); string B = Console.ReadLine(); A.ToArray(); B.ToArray(); for(int i = 0; i < A.Length; i++) { for(int j = 0; j < B.Length; j++) { if(A[i] == B[i]) { count++; break; } } } if(A.Length - 1 == count) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }