import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String strA = br.readLine(); String strB = br.readLine(); boolean result = Stream.of(strA.split("")).sorted().collect(Collectors.joining()) .equals(Stream.of(strB.split("")).sorted().collect(Collectors.joining())); System.out.println(result ? "YES" : "NO"); } }