#include <bits/stdc++.h>
using std::cin;
using std::complex;
using std::cout;
using std::endl;
using std::fixed;
using std::lower_bound;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::setprecision;
using std::sort;
using std::stack;
using std::stoi;
using std::stoll;
using std::string;
using std::to_string;
using std::tuple;
using std::upper_bound;
using std::vector;
template <typename T>
using Vec = vector<T>;
int main(void) {
  string s;
  string t;
  cin >> s >> t;
  int slen = s.length();
  int tlen = s.length();
  Vec<int> scount(26, 0);
  Vec<int> tcount(26, 0);
  for (int i = 0; i < slen; i++) {
    scount[(int)(s[i] - 'a')]++;
  }
  for (int i = 0; i < tlen; i++) {
    tcount[t[i] - 'a']++;
  }
  string odd = "";
  string even = "";
  for (int i = 0; i < slen; i++) {
    if ((i + 1) % 2 == 1) {
      odd += s[i];
    } else {
      even += s[i];
    }
  }
  Vec<int> ocount(26, 0);
  Vec<int> ecount(26, 0);
  for (int i = 0; i < (int)odd.size(); i++) {
    ocount[odd[i] - 'a']++;
  }
  for (int i = 0; i < (int)even.size(); i++) {
    ecount[even[i] - 'a']++;
  }
  bool odds = true;
  bool oddt = true;
  bool evens = true;
  bool event = true;
  for (int i = 0; i < 26; i++) {
    if (ocount[i] > scount[i]) {
      odds = false;
    }
    if (ecount[i] > scount[i]) {
      evens = false;
    }
    if (ocount[i] > tcount[i]) {
      oddt = false;
    }
    if (ecount[i] > tcount[i]) {
      event = false;
    }
  }
  if ((odds == true && event == true) || (oddt == true && evens == true)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
