defmodule Main do
  def main do
    s =
      IO.read(:line)
      |> String.trim |> String.to_charlist
    t =
      IO.read(:line)
      |> String.trim |> String.to_charlist
    if Enum.sort(s) == Enum.sort(t) do
      IO.puts("Yes")
      else
      IO.puts("No")
      end
  end
end
