import java.util.Arrays; import java.util.Scanner; public class No69 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); String[] Aarr = A.split(""); String[] Barr = B.split(""); Arrays.sort(Aarr); Arrays.sort(Barr); String re = "YES"; for (int i = 0; i < Aarr.length; i++) { if(!Aarr[i].equals(Barr[i])) { re = "NO"; break; } } System.out.println(re); } }