import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Tester2 { 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); System.out.println(Arrays.equals(a, b)?"YES":"NO"); }catch(IOException e) { e.printStackTrace(); } } }