S = eval(input())

T = eval(input())

a_idx = ord('a')

S_Lis = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [], 11: [], 12: [],

         13: [], 14: [], 15: [], 16: [], 17: [], 18: [], 19: [], 20: [], 21: [], 22: [], 23: [], 24: [], 25: []}

T_Lis = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [], 11: [], 12: [],

         13: [], 14: [], 15: [], 16: [], 17: [], 18: [], 19: [], 20: [], 21: [], 22: [], 23: [], 24: [], 25: []}

leng = len(S)

for i in range(leng):

    S_Lis[ord(S[i]) - a_idx].append(i)

    T_Lis[ord(T[i]) - a_idx].append(i)

if sorted(S_Lis.values()) == sorted(T_Lis.values()):

    print("Yes")

else:

    print("No")
import collections

S = list(eval(input()))

T = list(eval(input()))

if sorted(collections.Counter(S).values()) == sorted(collections.Counter(T).values()):

    print("Yes")

else:

    print("No")
S = eval(input())
T = eval(input())
a_idx = ord("a")
S_Lis = {
    0: [],
    1: [],
    2: [],
    3: [],
    4: [],
    5: [],
    6: [],
    7: [],
    8: [],
    9: [],
    10: [],
    11: [],
    12: [],
    13: [],
    14: [],
    15: [],
    16: [],
    17: [],
    18: [],
    19: [],
    20: [],
    21: [],
    22: [],
    23: [],
    24: [],
    25: [],
}
T_Lis = {
    0: [],
    1: [],
    2: [],
    3: [],
    4: [],
    5: [],
    6: [],
    7: [],
    8: [],
    9: [],
    10: [],
    11: [],
    12: [],
    13: [],
    14: [],
    15: [],
    16: [],
    17: [],
    18: [],
    19: [],
    20: [],
    21: [],
    22: [],
    23: [],
    24: [],
    25: [],
}
leng = len(S)
for i in range(leng):
    S_Lis[ord(S[i]) - a_idx].append(i)
    T_Lis[ord(T[i]) - a_idx].append(i)
if sorted(S_Lis.values()) == sorted(T_Lis.values()):
    print("Yes")
else:
    print("No")

import collections

S = list(eval(input()))
T = list(eval(input()))
if sorted(collections.Counter(S).values()) == sorted(collections.Counter(T).values()):
    print("Yes")
else:
    print("No")

-S = eval(input()) -T = eval(input()) -a_idx = ord("a") -S_Lis = { -    0: [], -    1: [], -    2: [], -    3: [], -    4: [], -    5: [], -    6: [], -    7: [], -    8: [], -    9: [], -    10: [], -    11: [], -    12: [], -    13: [], -    14: [], -    15: [], -    16: [], -    17: [], -    18: [], -    19: [], -    20: [], -    21: [], -    22: [], -    23: [], -    24: [], -    25: [], -} -T_Lis = { -    0: [], -    1: [], -    2: [], -    3: [], -    4: [], -    5: [], -    6: [], -    7: [], -    8: [], -    9: [], -    10: [], -    11: [], -    12: [], -    13: [], -    14: [], -    15: [], -    16: [], -    17: [], -    18: [], -    19: [], -    20: [], -    21: [], -    22: [], -    23: [], -    24: [], -    25: [], -} -leng = len(S) -for i in range(leng): -    S_Lis[ord(S[i]) - a_idx].append(i) -    T_Lis[ord(T[i]) - a_idx].append(i) -if sorted(S_Lis.values()) == sorted(T_Lis.values()): +import collections + +S = list(eval(input())) +T = list(eval(input())) +if sorted(collections.Counter(S).values()) == sorted(collections.Counter(T).values()):