import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); char[] s1 = a.toCharArray(); char[] s2 = b.toCharArray(); Arrays.sort(s1); Arrays.sort(s2); for(int i = 0 ; i < a.length() ; i++) { if(s1[i] != s2[i]) { System.out.println("NO"); return; } } System.out.println("Yes"); } }