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