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