/**
 * Created by IntelliJ IDEA.
 * User: m09aaa
 * Date: 07.09.2009
 * Time: 14:11:09
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import java.io.*;

   public class nusya {
        public static void main ( String[] args ) throws Exception
        {
            Scanner in=new Scanner (new File("anagrams.in"));
            PrintWriter out=new PrintWriter (new File("anagrams.out"));
            String s1=in.next();
            String s2=in.next();
            if (s1.length()!=s2.length())
            {
                out.println("NO");
            }
            else
            {
                if (s1.equalsIgnoreCase(s2))
                {
                    out.println("YES");
                }
                else
                {
                    



                }
            }
            out.close ();
        }
   }

