sS = input().rstrip()

sT = input().rstrip()









def fConv2B(sA):

    iL = len(sA)

    dA = {}

    for s in "abcdefghijklmnopqrstuvwxyz":

        dA[s] = 0

    iCounter = 1

    for i in range(iL):

        s = sA[i]

        if s in dA:

            if dA[sA[i]] == 0:

                dA[sA[i]] = iCounter

                iCounter += 1

        if  iCounter  == 27 :

            break



    aR = [0]*iL

    for i in range(iL):

        aR[i] = dA[sA[i]]

#   print(aR)

    return aR







if fConv2B(sS) == fConv2B(sT) :

    print("Yes")

else:

    print("No")

sS = input().rstrip()

sT = input().rstrip()



aS = [0] * 26

aT = [0] * 26

sABC = "abcdefghijklmnopqrstuvwxyz"

for i in range(26):

    aS[i]=sS.count(sABC[i])

    aT[i]=sT.count(sABC[i])

aS.sort()

aT.sort()

if aS == aT:

    print ("Yes")

else:

    print ("No")

sS = input().rstrip()
sT = input().rstrip()


def fConv2B(sA):
    iL = len(sA)
    dA = {}
    for s in "abcdefghijklmnopqrstuvwxyz":
        dA[s] = 0
    iCounter = 1
    for i in range(iL):
        s = sA[i]
        if s in dA:
            if dA[sA[i]] == 0:
                dA[sA[i]] = iCounter
                iCounter += 1
        if iCounter == 27:
            break
    aR = [0] * iL
    for i in range(iL):
        aR[i] = dA[sA[i]]
    #   print(aR)
    return aR


if fConv2B(sS) == fConv2B(sT):
    print("Yes")
else:
    print("No")

sS = input().rstrip()
sT = input().rstrip()
aS = [0] * 26
aT = [0] * 26
sABC = "abcdefghijklmnopqrstuvwxyz"
for i in range(26):
    aS[i] = sS.count(sABC[i])
    aT[i] = sT.count(sABC[i])
aS.sort()
aT.sort()
if aS == aT:
    print("Yes")
else:
    print("No")

- - -def fConv2B(sA): -    iL = len(sA) -    dA = {} -    for s in "abcdefghijklmnopqrstuvwxyz": -        dA[s] = 0 -    iCounter = 1 -    for i in range(iL): -        s = sA[i] -        if s in dA: -            if dA[sA[i]] == 0: -                dA[sA[i]] = iCounter -                iCounter += 1 -        if iCounter == 27: -            break -    aR = [0] * iL -    for i in range(iL): -        aR[i] = dA[sA[i]] -    #   print(aR) -    return aR - - -if fConv2B(sS) == fConv2B(sT): +aS = [0] * 26 +aT = [0] * 26 +sABC = "abcdefghijklmnopqrstuvwxyz" +for i in range(26): +    aS[i] = sS.count(sABC[i]) +    aT[i] = sT.count(sABC[i]) +aS.sort() +aT.sort() +if aS == aT: