s = eval(input())

t = eval(input())

alfa = list('abcdefghijklmnopqrstuvwxyz')

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

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

for i in range(len(s)):

    x = alfa.index(s[i])

    y = alfa.index(t[i])

    s_count[x] += 1

    t_count[y] += 1

s_count.sort()

t_count.sort()

if s_count == t_count:

    print('Yes')

else:

    print('No')

s = list(eval(input()))

t = list(eval(input()))

s_len = len(set(s))

t_len = len(set(t))

pare = []

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

    pare.append(i+j)



if len(set(pare)) == s_len == t_len:

    print('Yes')

else:

    print('No')

s = eval(input())
t = eval(input())
alfa = list("abcdefghijklmnopqrstuvwxyz")
s_count = [0 for i in range(26)]
t_count = [0 for i in range(26)]
for i in range(len(s)):
    x = alfa.index(s[i])
    y = alfa.index(t[i])
    s_count[x] += 1
    t_count[y] += 1
s_count.sort()
t_count.sort()
if s_count == t_count:
    print("Yes")
else:
    print("No")

s = list(eval(input()))
t = list(eval(input()))
s_len = len(set(s))
t_len = len(set(t))
pare = []
for i, j in zip(s, t):
    pare.append(i + j)
if len(set(pare)) == s_len == t_len:
    print("Yes")
else:
    print("No")

-s = eval(input()) -t = eval(input()) -alfa = list("abcdefghijklmnopqrstuvwxyz") -s_count = [0 for i in range(26)] -t_count = [0 for i in range(26)] -for i in range(len(s)): -    x = alfa.index(s[i]) -    y = alfa.index(t[i]) -    s_count[x] += 1 -    t_count[y] += 1 -s_count.sort() -t_count.sort() -if s_count == t_count: +s = list(eval(input())) +t = list(eval(input())) +s_len = len(set(s)) +t_len = len(set(t)) +pare = [] +for i, j in zip(s, t): +    pare.append(i + j) +if len(set(pare)) == s_len == t_len: