using System; using System.Linq; public class P0069 { public static void Main() { var a = Console.ReadLine().Trim().ToCharArray().ToList(); var b = Console.ReadLine().Trim().ToCharArray().ToList(); a.Sort(); b.Sort(); if(String.Join("", a) == String.Join("", b)) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } }