import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); String a=sc.next(); String b=sc.next(); char[] array_a=a.toCharArray(); char[] array_b=b.toCharArray(); Arrays.sort(array_a); Arrays.sort(array_b); a=new String(array_a); b=new String(array_b); //System.out.println(a+" "+b); if(a.equals(b)){ System.out.println("YES"); }else{ System.out.println("NO"); } } }