S = sorted(eval(input()))

T = sorted(eval(input()))

S_list = []

T_list = []

for alp in "abcdefghijklmnopqrstuvwxyz":

  S_list.append(S.count(alp))

  T_list.append(T.count(alp))

if(sorted(S_list) != sorted(T_list)):

  print('No')

else:

  print('Yes')
S = eval(input())

T = eval(input())

s = []

t = []

for alp in "abcdefghijklmnopqrstuvwxyz":

  s.append(S.count(alp))

  t.append(T.count(alp))

if(sorted(s) == sorted(t)):

  print("Yes")

else:

  print("No")

S = sorted(eval(input()))
T = sorted(eval(input()))
S_list = []
T_list = []
for alp in "abcdefghijklmnopqrstuvwxyz":
    S_list.append(S.count(alp))
    T_list.append(T.count(alp))
if sorted(S_list) != sorted(T_list):
    print("No")
else:
    print("Yes")

S = eval(input())
T = eval(input())
s = []
t = []
for alp in "abcdefghijklmnopqrstuvwxyz":
    s.append(S.count(alp))
    t.append(T.count(alp))
if sorted(s) == sorted(t):
    print("Yes")
else:
    print("No")

-S = sorted(eval(input())) -T = sorted(eval(input())) -S_list = [] -T_list = [] +S = eval(input()) +T = eval(input()) +s = [] +t = [] -    S_list.append(S.count(alp)) -    T_list.append(T.count(alp)) -if sorted(S_list) != sorted(T_list): +    s.append(S.count(alp)) +    t.append(T.count(alp)) +if sorted(s) == sorted(t): +    print("Yes") +else: -else: -    print("Yes")