import java.util.*;
import java.io.*;



public class Main {

     static PrintWriter p;

     public static void main(String[] args) throws Exception{
        Scanner s= new Scanner(new File("anagrams.in"));
         p = new PrintWriter(new File("anagrams.out"));
         int [] letters = new int [128];
         boolean ana = true;

         String st = s.next();
         s.nextLine();
         st.toUpperCase();

         for(int i = 0; i < st.length(); i++)
             letters[(st.charAt(i))]++;

         st = s.next();
         st.toUpperCase();

         for(int i = 0; i < st.length(); i++)
             letters[(st.charAt(i))]--;

         for(int i = 0; i < 128; i++)
            if(letters[i]!=0)
                ana = false;
         if(ana)
            p.println("YES");
         else
            p.print("NO");
         p.close();


}
}


