package yukicoder; import java.util.Arrays; import java.util.Scanner; public class Yuki69 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String A = scan.next(); String B = scan.next(); scan.close(); char[] a = A.toCharArray(); Arrays.sort(a); A = String.valueOf(a); char[] b = B.toCharArray(); Arrays.sort(b); B = String.valueOf(b); if (A.equals(B)) { System.out.println("YES"); } else { System.out.println("NO"); } } }