package me.yukicoder.lv1; 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[] a = br.readLine().toCharArray(); char[] b = br.readLine().toCharArray(); Arrays.sort(a); Arrays.sort(b); if (Arrays.equals(a, b)) { System.out.println("YES"); } else { System.out.println("NO"); } } catch (IOException e) { e.printStackTrace(); } } }