import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { // xor の性質 (X ^ Y) ^ X = Y より, F0, F1, F0 ^ F1, F0, F1, ... とループする. public static void main(String[] args){ Scanner sc = new Scanner(System.in); final String A = sc.next(); final String B = sc.next(); final int SIZE = 26; int[] A_count = new int[SIZE]; int[] B_count = new int[SIZE]; for(char c : A.toCharArray()){ A_count[c - 'a']++; } for(char c : B.toCharArray()){ B_count[c - 'a']++; } boolean ok = true; for(int i = 0; i < SIZE; i++){ if(A_count[i] != B_count[i]){ ok = false; break; } } System.out.println(ok ? "YES" : "NO"); } }