import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class No0068 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { // char→intに変換し、ソートと比較を行う char[] a = br.readLine().toCharArray(); char[] b = br.readLine().toCharArray(); int[] aCode = toCode(a); int[] bCode = toCode(b); Arrays.sort(aCode); Arrays.sort(bCode); if(Arrays.equals(aCode,bCode)){ System.out.println("YES"); }else{ System.out.println("NO"); } } catch (IOException e) { e.printStackTrace(); } } static int[] toCode(char[] chr){ int[] code = new int[chr.length]; for(int i =0; i < chr.length; i++){ code[i] = (int)chr[i]; } return code; } }