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