import java.util.Scanner; import java.util.Arrays; public class no69{ public static void main(String... args){ Scanner scan = new Scanner(System.in); String a = scan.next(); String b = scan.next(); String a1[] = a.split(""); String b1[] = b.split(""); Arrays.sort(a1); Arrays.sort(b1); int res = 0; for(int i = 0; i < a.length(); i++){ if(a1[i].equals(b1[i])){ res++; } } System.out.println((res == a.length())?"YES":"NO"); } }