import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto S = readln.chomp.to!(dchar[]);
    sort(S);
    auto T = readln.chomp.to!(dchar[]);
    sort(T);
    writeln(S == T ? "Yes" : "No");
}