word1 = eval(input())

word2 = eval(input())



def cnt_element(x):

    dict = {}

    for i in x:

        if i not in dict:

            dict[i] = 1

        else:

            dict[i] += 1

    return  sorted([x for x in list(dict.values())],reverse=True)



if cnt_element(word1) == cnt_element(word2):

    print('Yes')

else:

    print('No')
from collections import Counter



S = eval(input())

T = eval(input())



s = list(Counter(S).values())

t = list(Counter(T).values())

s.sort(reverse=True)

t.sort(reverse=True)



for i,j in zip(s,t):

    if i != j:

        print('No')

        break

else:

    print('Yes')
word1 = eval(input())
word2 = eval(input())


def cnt_element(x):
    dict = {}
    for i in x:
        if i not in dict:
            dict[i] = 1
        else:
            dict[i] += 1
    return sorted([x for x in list(dict.values())], reverse=True)


if cnt_element(word1) == cnt_element(word2):
    print("Yes")
else:
    print("No")

from collections import Counter

S = eval(input())
T = eval(input())
s = list(Counter(S).values())
t = list(Counter(T).values())
s.sort(reverse=True)
t.sort(reverse=True)
for i, j in zip(s, t):
    if i != j:
        print("No")
        break
else:
    print("Yes")

-word1 = eval(input()) -word2 = eval(input()) +from collections import Counter - -def cnt_element(x): -    dict = {} -    for i in x: -        if i not in dict: -            dict[i] = 1 -        else: -            dict[i] += 1 -    return sorted([x for x in list(dict.values())], reverse=True) - - -if cnt_element(word1) == cnt_element(word2): +S = eval(input()) +T = eval(input()) +s = list(Counter(S).values()) +t = list(Counter(T).values()) +s.sort(reverse=True) +t.sort(reverse=True) +for i, j in zip(s, t): +    if i != j: +        print("No") +        break +else: -else: -    print("No")