import java.util.Scanner; public class No69 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); int len = A.length(); boolean[] c = new boolean[len]; int index; for (int i = 0; i < len; i++) { for (int j = 0; j < len; j++) { if(A.charAt(i) == B.charAt(j) && !c[j]){ c[j] = true; break; }else if(j == len - 1){ System.out.println("NO"); return; } } } System.out.println("YES"); } }