output_description: If S and T can be made equal, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
      T
attempt: use std::collections::{HashMap,HashSet};
  #[allow(unused_macros)]
  macro_rules! invec {
      ( $t:ty ) => {{
          let mut s = String::new();
          match std::io::stdin().read_line(&mut s) {
              Ok(0) => Vec::<$t>::new(),
              Ok(n) => s
                  .trim()
                  .split_whitespace()
                  .map(|s| s.parse::<$t>().unwrap())
                  .collect::<Vec<$t>>(),
              Err(_) => Vec::<$t>::new(),
          }
      }};
  }
  
  #[allow(unused_macros)]
  macro_rules! input {
      ( $($t:ty),* ) => {{
          let mut s = String::new();
          std::io::stdin().read_line(&mut s);
          let mut splits = s.trim().split_whitespace();
          ($(
              {
                   splits.next().unwrap().parse::<$t>().unwrap()
              },
          )*)
      }}
  }
  
  // #[allow(unused_must_use)]
  // fn trans(s: &Vec<u8>, s_i: u8, t_i: u8) -> Vec<u8> {
  //     let mut res = Vec::<u8>::with_capacity(s.len());
  //     for i in 0..s.len() {
  //         if s[i] == s_i {
  //             res.push(t_i);
  //         } else if s[i] == t_i {
  //             res.push(s_i);
  //         } else {
  //             res.push(s[i]);
  //         };
  //     }
  //     return res;
  // }
  
  #[allow(unused_must_use)]
  #[allow(unused_variables)]
  fn solve() {
      let (s,) = input!(String);
      let (t,) = input!(String);
  
      let mut m = HashMap::new();
  
      let mut t = t.chars();
  
      for c in s.chars() {
          let aft = t.next().unwrap();
          if let Some(val) = m.get(&c) {
              if val == &aft {
                  println!("continue");
                  continue;
              } else {
                  println!("No");
                  std::process::exit(0);
              }
          }
  
          m.insert(c, aft);
      }
  
      let set = m.values().collect::<HashSet<_>>();
  
      if set.len() == m.len() {
          println!("Yes");
      } else {
          println!("No");
      }
  
  }
  
  fn main() {
      solve();
  }
  
problem_description: Statement
  
  You are given strings S and T consisting of lowercase English letters.
  
  You can perform the following operation on S any number of times:
  
  Operation: Choose two distinct lowercase English letters c_1 and c_2, then
  replace every occurrence of c_1 with c_2, and every occurrence of c_2 with
  c_1.
  
  Determine if S and T can be made equal by performing the operation zero or
  more times.
samples: [{"input": "azzel\n    apple", "output": "Yes\n    \n\n`azzel` can be changed to `apple`, as follows:\n\n  * Choose `e` as c_1 and `l` as c_2. `azzel` becomes `azzle`.\n  * Choose `z` as c_1 and `p` as c_2. `azzle` becomes `apple`.\n\n* * *"}, {"input": "chokudai\n    redcoder", "output": "No\n    \n\nNo sequences of operation can change `chokudai` to `redcoder`.\n\n* * *"}, {"input": "abcdefghijklmnopqrstuvwxyz\n    ibyhqfrekavclxjstdwgpzmonu", "output": "Yes"}]