a = gets.chomp b = gets.chomp if a.split('').sort == b.split('').sort puts 'YES' else puts 'NO' end