import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); char[] charA = A.toCharArray(); char[] charB = B.toCharArray(); Arrays.sort(charA); Arrays.sort(charB); if(String.valueOf(charA).equals(String.valueOf(charB))) { System.out.println("YES"); } else { System.out.println("NO"); } } }