"use strict"
function main(input) {

	input = input.split('\n')
	if( input[0]sort() == input[1].sort() ) console.log('Yes')
	else console.log('No')


}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));