a, b = gets.to_s.split a = a.chars.sort.join b = b.chars.sort.join puts (a == b ? "YES" : "NO")