local s = {};
local t = {};

for v in string.gmatch(io.read(),"%w") do
  table.insert(s, v);
end

for v in string.gmatch(io.read(),"%w") do
  table.insert(t, v);
end

table.sort(s);
table.sort(t);

local result = "Yes";
for i = 1, #s do
  if s[i] ~= t[i] then
    result = "No";
    break;
  end
end

print(result);