import java.util.Scanner; import java.util.Arrays; class No_69{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); char[] arraya = new char[a.length()]; char[] arrayb = new char[b.length()]; int cnt = 0; for(int i = 0;i < a.length();i++){ arraya[i] = a.charAt(i); arrayb[i] = b.charAt(i); } Arrays.sort(arraya); Arrays.sort(arrayb); for(int i = 0;i < a.length();i++){ if(arraya[i] != arrayb[i]){ break; } cnt++; } if(cnt == a.length()){ System.out.println("YES"); }else{ System.out.println("NO"); } } }