output_description: Print the maximum possible amount of the allowance.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: mod = 10**9 + 7
  mod2 = 2**61 + 1
  from collections import deque
  import heapq
  from bisect import bisect_left, insort_left, bisect_right
  
  
  def iip(listed=True):
      ret = [int(i) for i in input().split()]
      if len(ret) == 1 and not listed:
          return ret[0]
      return ret
  
  
  def iip_ord():
      return [ord(i) - ord("a") for i in input()]
  
  
  def main():
      ans = solve()
      if ans is not None:
          print(ans)
  
  
  def solve():
      # N, M = iip(False)
      S = input()
      T = input()
  
      d1 = {}
      d2 = {}
      for s, t in zip(S, T):
          if t not in d1:
              d1[t] = s
              d2[s] = t
          if s not in d2:
              d2[s] = t
              d1[t] = s
  
              # print(t, t, d[s])
          if d1[t] != s or d2[s] != t:
              print("No")
              return
      print("Yes")
  
  
  #####################################################ライブラリ集ここから
  
  
  def fprint(s):
      for i in s:
          print(i)
  
  
  def split_print_space(s):
      print(" ".join([str(i) for i in s]))
  
  
  def split_print_enter(s):
      print("\n".join([str(i) for i in s]))
  
  
  def koenai_saidai_x_index(sorted_list, n):
      l = 0
      r = len(sorted_list)
      if len(sorted_list) == 0:
          return False
      if sorted_list[0] > n:
          return False
  
      while r - l > 1:
          x = (l + r) // 2
          if sorted_list[x] == n:
              return x
          elif sorted_list[x] > n:
              r = x
          else:
              l = x
      return l
  
  
  def searchsorted(sorted_list, n, side):
      if side not in ["right", "left"]:
          raise Exception("sideはrightかleftで指定してください")
  
      l = 0
      r = len(sorted_list)
  
      if n > sorted_list[-1]:
          # print(sorted_list)
          return len(sorted_list)
      if n < sorted_list[0]:
          return 0
  
      while r - l > 1:
          x = (l + r) // 2
          if sorted_list[x] > n:
              r = x
          elif sorted_list[x] < n:
              l = x
          else:
              if side == "left":
                  r = x
              elif side == "right":
                  l = x
  
      if side == "left":
          if sorted_list[l] == n:
              return r - 1
          else:
              return r
  
      if side == "right":
          if sorted_list[l] == n:
              return l + 1
          else:
              return l
  
  
  def soinsuu_bunkai(n):
      ret = []
      for i in range(2, int(n**0.5) + 1):
          while n % i == 0:
              n //= i
              ret.append(i)
          if i > n:
              break
      if n != 1:
          ret.append(n)
      return ret
  
  
  def conbination(n, r, mod, test=False):
      if n <= 0:
          return 0
      if r == 0:
          return 1
      if r < 0:
          return 0
      if r == 1:
          return n
      ret = 1
      for i in range(n - r + 1, n + 1):
          ret *= i
          ret = ret % mod
  
      bunbo = 1
      for i in range(1, r + 1):
          bunbo *= i
          bunbo = bunbo % mod
  
      ret = (ret * inv(bunbo, mod)) % mod
      if test:
          # print(f"{n}C{r} = {ret}")
          pass
      return ret
  
  
  def inv(n, mod):
      return power(n, mod - 2)
  
  
  def power(n, p, mod_=mod):
      if p == 0:
          return 1
      if p % 2 == 0:
          return (power(n, p // 2, mod_) ** 2) % mod_
      if p % 2 == 1:
          return (n * power(n, p - 1, mod_)) % mod_
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You have decided to give an allowance to your child depending on the outcome
  of the game that he will play now.
  
  The game is played as follows:
  
    * There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a `+` printed on it.
    * The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)
    * Then, the amount of the allowance will be equal to the resulting value of the formula.
  
  Given the values A, B and C printed on the integer panels used in the game,
  find the maximum possible amount of the allowance.
samples: [{"input": "1 5 2", "output": "53\n    \n\nThe amount of the allowance will be 53 when the panels are arranged as `52+1`,\nand this is the maximum possible amount.\n\n* * *"}, {"input": "9 9 9", "output": "108\n    \n\n* * *"}, {"input": "6 6 7", "output": "82"}]