import java.util.Arrays; import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] c1 = sc.next().toCharArray(), c2 = sc.next().toCharArray(); Arrays.sort(c1); Arrays.sort(c2); for(int i = 0; i < c1.length; i++){ if(c1[i] != c2[i]){ System.out.println("NO"); return; } } System.out.println("YES"); } }