s = input()
t = input()
def solve():
for i in range(16):
tmp = ""
v = [0, 0, 0, 0]
for c in s:
shift = ord(c) - ord('A')
v[shift] += 1
if ((v[shift] % 2) << shift) ^ ((1 << shift) & i):
tmp += c
if tmp == t:
print("Yes")
return
print("No")
solve()