import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); String a = koko.next(); String b = koko.next(); char[] ah = a.toCharArray(); char[] bh = b.toCharArray(); Arrays.sort(ah); Arrays.sort(bh); String an = String.valueOf(ah); String bn = String.valueOf(bh); if(an.equals(bn)){ System.out.println("YES"); }else{ System.out.println("NO"); } } }