import java.util.Arrays; import java.util.Scanner; public class No69 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String a = s.next(); String b = s.next(); char[] aa = a.toCharArray(); char[] ba = b.toCharArray(); Arrays.sort(aa); Arrays.sort(ba); if (Arrays.equals(aa, ba)) { System.out.println("YES"); } else { System.out.println("NO"); } } }