str1 = gets.chomp # 2行目 str2 = gets.chomp puts str1.chars.sort == str2.chars.sort ? "Yes" : "No"