program main
	implicit none
    character(100) S, T
	integer chaS(1:26), chaT(1:26), i, INFO
	read(*, *) S, T
	chaS = 0
	chaT = 0
	do i = 1, len_trim(S)
		if(S(i:i) == 'a') then
			chaS(1) = chaS(1) + 1
		else if(S(i:i) == 'b') then
			chaS(2) = chaS(2) + 1
		else if(S(i:i) == 'c') then
			chaS(3) = chaS(3) + 1
		else if(S(i:i) == 'd') then
			chaS(4) = chaS(4) + 1
		else if(S(i:i) == 'e') then
			chaS(5) = chaS(5) + 1
		else if(S(i:i) == 'f') then
			chaS(6) = chaS(6) + 1
		else if(S(i:i) == 'g') then
			chaS(7) = chaS(7) + 1
		else if(S(i:i) == 'h') then
			chaS(8) = chaS(8) + 1
		else if(S(i:i) == 'i') then
			chaS(9) = chaS(9) + 1
		else if(S(i:i) == 'j') then
			chaS(10) = chaS(10) + 1
		else if(S(i:i) == 'k') then
			chaS(11) = chaS(11) + 1
		else if(S(i:i) == 'l') then
			chaS(12) = chaS(12) + 1
		else if(S(i:i) == 'm') then
			chaS(13) = chaS(13) + 1
		else if(S(i:i) == 'n') then
			chaS(14) = chaS(14) + 1
		else if(S(i:i) == 'o') then
			chaS(15) = chaS(15) + 1
		else if(S(i:i) == 'p') then
			chaS(16) = chaS(16) + 1
		else if(S(i:i) == 'q') then
			chaS(17) = chaS(17) + 1
		else if(S(i:i) == 'r') then
			chaS(18) = chaS(18) + 1
		else if(S(i:i) == 's') then
			chaS(19) = chaS(19) + 1
		else if(S(i:i) == 't') then
			chaS(20) = chaS(20) + 1
		else if(S(i:i) == 'u') then
			chaS(21) = chaS(21) + 1
		else if(S(i:i) == 'v') then
			chaS(22) = chaS(22) + 1
		else if(S(i:i) == 'w') then
			chaS(23) = chaS(23) + 1
		else if(S(i:i) == 'x') then
			chaS(24) = chaS(24) + 1
		else if(S(i:i) == 'y') then
			chaS(25) = chaS(25) + 1
		else if(S(i:i) == 'z') then
			chaS(26) = chaS(26) + 1
		end if
	end do
	do i = 1, len_trim(T)
		if(T(i:i) == 'a') then
			chaT(1) = chaT(1) + 1
		else if(T(i:i) == 'b') then
			chaT(2) = chaT(2) + 1
		else if(T(i:i) == 'c') then
			chaT(3) = chaT(3) + 1
		else if(T(i:i) == 'd') then
			chaT(4) = chaT(4) + 1
		else if(T(i:i) == 'e') then
			chaT(5) = chaT(5) + 1
		else if(T(i:i) == 'f') then
			chaT(6) = chaT(6) + 1
		else if(T(i:i) == 'g') then
			chaT(7) = chaT(7) + 1
		else if(T(i:i) == 'h') then
			chaT(8) = chaT(8) + 1
		else if(T(i:i) == 'i') then
			chaT(9) = chaT(9) + 1
		else if(T(i:i) == 'j') then
			chaT(10) = chaT(10) + 1
		else if(T(i:i) == 'k') then
			chaT(11) = chaT(11) + 1
		else if(T(i:i) == 'l') then
			chaT(12) = chaT(12) + 1
		else if(T(i:i) == 'm') then
			chaT(13) = chaT(13) + 1
		else if(T(i:i) == 'n') then
			chaT(14) = chaT(14) + 1
		else if(T(i:i) == 'o') then
			chaT(15) = chaT(15) + 1
		else if(T(i:i) == 'p') then
			chaT(16) = chaT(16) + 1
		else if(T(i:i) == 'q') then
			chaT(17) = chaT(17) + 1
		else if(T(i:i) == 'r') then
			chaT(18) = chaT(18) + 1
		else if(T(i:i) == 's') then
			chaT(19) = chaT(19) + 1
		else if(T(i:i) == 't') then
			chaT(20) = chaT(20) + 1
		else if(T(i:i) == 'u') then
			chaT(21) = chaT(21) + 1
		else if(T(i:i) == 'v') then
			chaT(22) = chaT(22) + 1
		else if(T(i:i) == 'w') then
			chaT(23) = chaT(23) + 1
		else if(T(i:i) == 'x') then
			chaT(24) = chaT(24) + 1
		else if(T(i:i) == 'y') then
			chaT(25) = chaT(25) + 1
		else if(T(i:i) == 'z') then
			chaT(26) = chaT(26) + 1
		end if
	end do
	INFO = 0
	do i = 1, 26
		if(chaS(i) /= chaT(i)) then
			INFO = -1
		end if
	end do
	if(INFO == -1) then
		write(*, *) 'No'
	else
		write(*, *) 'Yes'
	end if
end program main