a = gets.chomp.split('') b = gets.chomp.split('') puts a.sort! == b.sort! ? "YES" : "NO"