s1, s2 = map(str,raw_input().split())
count = 0
for i in range(len(s1)):
  if s1.count(s1[i]) == s2.count(s2[i]):
    count += 1
if count == len(s1):
  print "yes"
else:
  print "no"

cce8873d4ab1083c21d91bf01eb496d7e67086ed
s1, s2 = map(str,raw_input().split())
count = 0
for i in range(len(s1)):
  if s1.count(s1[i]) == s2.count(s2[i]):
    count += 1
if count == len(s1):
  print "yes"
else:
  print "no"
