using System; using System.Linq; class Program { public void Solve() { char[] A = Console.ReadLine().ToCharArray(); char[] B = Console.ReadLine().ToCharArray(); Array.Sort(A); Array.Sort(B); string strA = new string(A); string strB = new string(B); Console.WriteLine(strA.Equals(strB) ? "YES" : "NO"); } static void Main() { var solver = new Program(); solver.Solve(); } }