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