import sys

S = list(eval(input()))

T = list(eval(input()))

#print (S)



dic1 = dict()

dic2 = dict()

for i in range(len(S)):

    if not S[i] in list(dic1.keys()):

        dic1[S[i]] = 1

    else:

        dic1[S[i]] += 1

    if not T[i] in list(dic2.keys()):

        dic2[T[i]] = 1

    else:

        dic2[T[i]] += 1

#print(dic1)



dic1 = sorted(list(dic1.items()), key = lambda x:x[1])

dic2 = sorted(list(dic2.items()), key = lambda x:x[1])



for j in range(len(dic1)):

    if not dic1[j][1] == dic2[j][1]:

        print ('No')

        sys.exit()

print ('Yes')
import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 9)

MOD = 10 ** 9 + 7



from collections import Counter



S = list(eval(input()))

T = list(eval(input()))



SC = Counter(S)

TC = Counter(T)



lstS = []

for s in SC:

    lstS.append(SC[s])



lstT = []

for t in TC:

    lstT.append(TC[t])



lstS.sort()

lstT.sort()



if lstS == lstT:

    print ('Yes')

else:

    print ('No')
import sys

S = list(eval(input()))
T = list(eval(input()))
# print (S)
dic1 = dict()
dic2 = dict()
for i in range(len(S)):
    if not S[i] in list(dic1.keys()):
        dic1[S[i]] = 1
    else:
        dic1[S[i]] += 1
    if not T[i] in list(dic2.keys()):
        dic2[T[i]] = 1
    else:
        dic2[T[i]] += 1
# print(dic1)
dic1 = sorted(list(dic1.items()), key=lambda x: x[1])
dic2 = sorted(list(dic2.items()), key=lambda x: x[1])
for j in range(len(dic1)):
    if not dic1[j][1] == dic2[j][1]:
        print("No")
        sys.exit()
print("Yes")

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**9)
MOD = 10**9 + 7
from collections import Counter

S = list(eval(input()))
T = list(eval(input()))
SC = Counter(S)
TC = Counter(T)
lstS = []
for s in SC:
    lstS.append(SC[s])
lstT = []
for t in TC:
    lstT.append(TC[t])
lstS.sort()
lstT.sort()
if lstS == lstT:
    print("Yes")
else:
    print("No")

+ +input = sys.stdin.readline +sys.setrecursionlimit(10**9) +MOD = 10**9 + 7 +from collections import Counter -# print (S) -dic1 = dict() -dic2 = dict() -for i in range(len(S)): -    if not S[i] in list(dic1.keys()): -        dic1[S[i]] = 1 -    else: -        dic1[S[i]] += 1 -    if not T[i] in list(dic2.keys()): -        dic2[T[i]] = 1 -    else: -        dic2[T[i]] += 1 -# print(dic1) -dic1 = sorted(list(dic1.items()), key=lambda x: x[1]) -dic2 = sorted(list(dic2.items()), key=lambda x: x[1]) -for j in range(len(dic1)): -    if not dic1[j][1] == dic2[j][1]: -        print("No") -        sys.exit() -print("Yes") +SC = Counter(S) +TC = Counter(T) +lstS = [] +for s in SC: +    lstS.append(SC[s]) +lstT = [] +for t in TC: +    lstT.append(TC[t]) +lstS.sort() +lstT.sort() +if lstS == lstT: +    print("Yes") +else: +    print("No")