import std.algorithm;
import std.conv;
import std.stdio;
import std.string;

void main()
{
	auto s = readln.strip;
	auto t = readln.strip;
	writeln( solve( s, t ) );
}

auto solve( in string s, in string t )
{
	auto ss = new int[ s.length ];
	auto ts = new int[ t.length ];
	
	foreach( i, c; s )
	{
		ss[ i ] = cast( int )( c );
	}
	foreach( i, c; t )
	{
		ts[ i ] = cast( int )( c );
	}

	return ( sort( ss ) == sort( ts ) ? "Yes" : "No" );
}
