a = gets.chomp.split("") b = gets.chomp.split("") puts (a - b).length == 0 ? "YES" : "NO"