import java.util.Arrays; import java.util.Scanner; public class Main_yukicoder69 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] a = sc.next().toCharArray(); char[] b = sc.next().toCharArray(); Arrays.sort(a); Arrays.sort(b); String aa = new String(a); String bb = new String(b); if (aa.equals(bb)) { System.out.println("YES"); } else { System.out.println("NO"); } sc.close(); } }