import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; class Main { public static void main(String[] args) throws IOException { 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"); } } }