from collections import*

c = Counter

f = lambda: c(list(c(eval(input())).values()))

print(("YNeos"[f()!=f()::2]))
def f():

  i = eval(input())

  return sorted(i.count(j) for j in set(i))

print(("YNeos"[f()!=f()::2]))
from collections import *

c = Counter
f = lambda: c(list(c(eval(input())).values()))
print(("YNeos"[f() != f() :: 2]))

def f():
    i = eval(input())
    return sorted(i.count(j) for j in set(i))


print(("YNeos"[f() != f() :: 2]))

-from collections import * +def f(): +    i = eval(input()) +    return sorted(i.count(j) for j in set(i)) -c = Counter -f = lambda: c(list(c(eval(input())).values())) +