import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); sc.close(); char[] chA = A.toCharArray(); char[] chB = B.toCharArray(); Arrays.sort(chA); Arrays.sort(chB); if(Arrays.equals(chA, chB)){ System.out.println("YES"); }else{ System.out.println("NO"); } }// mainmethod } // class