S = list(eval(input()))

T = list(eval(input()))

S2, T2 = [], []

St, Tt = [], []

for i in range(26):

    s = chr(ord('a') + i)

    St.append(S.count(s))

    Tt.append(T.count(s))

for i in range(len(S)):

    S2.append(St[ord(S[i]) - ord('a')])

    T2.append(Tt[ord(T[i]) - ord('a')])

if S2 != T2:

    print('No')

else:

    print('Yes')

s = eval(input())

t = eval(input())

sal = [0 for i in range(26)]

tal = [0 for i in range(26)]

s2, t2 = [], []

for i in range(26):

    sal[i] = s.count(chr(ord('a') + i))

    tal[i] = t.count(chr(ord('a') + i))

for i in range(len(s)):

    s2.append(sal[ord(s[i]) - ord('a')])

    t2.append(tal[ord(t[i]) - ord('a')])

if s2 != t2:

    print('No')

else:

    print('Yes')

S = list(eval(input()))
T = list(eval(input()))
S2, T2 = [], []
St, Tt = [], []
for i in range(26):
    s = chr(ord("a") + i)
    St.append(S.count(s))
    Tt.append(T.count(s))
for i in range(len(S)):
    S2.append(St[ord(S[i]) - ord("a")])
    T2.append(Tt[ord(T[i]) - ord("a")])
if S2 != T2:
    print("No")
else:
    print("Yes")

s = eval(input())
t = eval(input())
sal = [0 for i in range(26)]
tal = [0 for i in range(26)]
s2, t2 = [], []
for i in range(26):
    sal[i] = s.count(chr(ord("a") + i))
    tal[i] = t.count(chr(ord("a") + i))
for i in range(len(s)):
    s2.append(sal[ord(s[i]) - ord("a")])
    t2.append(tal[ord(t[i]) - ord("a")])
if s2 != t2:
    print("No")
else:
    print("Yes")

-S = list(eval(input())) -T = list(eval(input())) -S2, T2 = [], [] -St, Tt = [], [] +s = eval(input()) +t = eval(input()) +sal = [0 for i in range(26)] +tal = [0 for i in range(26)] +s2, t2 = [], [] -    s = chr(ord("a") + i) -    St.append(S.count(s)) -    Tt.append(T.count(s)) -for i in range(len(S)): -    S2.append(St[ord(S[i]) - ord("a")]) -    T2.append(Tt[ord(T[i]) - ord("a")]) -if S2 != T2: +    sal[i] = s.count(chr(ord("a") + i)) +    tal[i] = t.count(chr(ord("a") + i)) +for i in range(len(s)): +    s2.append(sal[ord(s[i]) - ord("a")]) +    t2.append(tal[ord(t[i]) - ord("a")]) +if s2 != t2: