s = str(eval(input()))

t = str(eval(input()))



ds = {}

dt = {}



for i in range(len(s)):

    if s[i] not in ds:

        ds[s[i]] = 1

    else:

        ds[s[i]] += 1



for i in range(len(t)):

    if t[i] not in dt:

        dt[t[i]] = 1

    else:

        dt[t[i]] += 1



vs = list(ds.values())

vt = list(dt.values())



vs.sort()

vt.sort()

#print(vs)

#print(vt)



if vs == vt:

    print('Yes')

else:

    print('No')
s = str(eval(input()))

t = str(eval(input()))



from collections import Counter

cs = Counter(s)

ct = Counter(t)



cs = list(cs.values())

ct = list(ct.values())



cs.sort()

ct.sort()



if cs == ct:

    print('Yes')

else:

    print('No')

s = str(eval(input()))
t = str(eval(input()))
ds = {}
dt = {}
for i in range(len(s)):
    if s[i] not in ds:
        ds[s[i]] = 1
    else:
        ds[s[i]] += 1
for i in range(len(t)):
    if t[i] not in dt:
        dt[t[i]] = 1
    else:
        dt[t[i]] += 1
vs = list(ds.values())
vt = list(dt.values())
vs.sort()
vt.sort()
# print(vs)
# print(vt)
if vs == vt:
    print("Yes")
else:
    print("No")

s = str(eval(input()))
t = str(eval(input()))
from collections import Counter

cs = Counter(s)
ct = Counter(t)
cs = list(cs.values())
ct = list(ct.values())
cs.sort()
ct.sort()
if cs == ct:
    print("Yes")
else:
    print("No")

-ds = {} -dt = {} -for i in range(len(s)): -    if s[i] not in ds: -        ds[s[i]] = 1 -    else: -        ds[s[i]] += 1 -for i in range(len(t)): -    if t[i] not in dt: -        dt[t[i]] = 1 -    else: -        dt[t[i]] += 1 -vs = list(ds.values()) -vt = list(dt.values()) -vs.sort() -vt.sort() -# print(vs) -# print(vt) -if vs == vt: +from collections import Counter + +cs = Counter(s) +ct = Counter(t) +cs = list(cs.values()) +ct = list(ct.values()) +cs.sort() +ct.sort() +if cs == ct: