import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s=new Scanner(System.in); char[] A=s.nextLine().toCharArray(),B=s.nextLine().toCharArray(); Arrays.sort(A);Arrays.sort(B); System.out.println(Arrays.equals(A,B)?"YES":"NO"); } }