import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] s1 = sc.next().toCharArray(); char[] s2 = sc.next().toCharArray(); Arrays.sort(s1); Arrays.sort(s2); System.out.println(Arrays.equals(s1, s2) ? "YES" : "NO"); } }