"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let X = xs[0].split('');
   let Y = xs[1].split('');
   X.sort();
   Y.sort();
   let len = X.length;
   let num = 0;
   for(let i=0; i<len; i++){
     if(X[i]==Y[i]){
     num +=1;
     }else{
     num +=0;
     }
   }
   //console.log(num)
  
   if(num == len){
     console.log('Yes');
     }else{    
     console.log('No');
     }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


