a = gets b = gets c = "YES" a.chars { |ch| c = "NO" if a.count("ch") == b.count("ch") } puts c