using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace A { class main { public main() { } public static int Main() { new main().run(); return 0; } void run() { Scanner cin = new Scanner(); String s = cin.next (); String t = cin.next (); char[] c1=s.ToCharArray(); char[] c2=t.ToCharArray(); Array.Sort(c1); Array.Sort(c2); s=new String(c1); t=new String(c2); if (s == t) Console.WriteLine ("YES"); else Console.WriteLine ("NO"); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return s[i++]; } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } } }