#include <bits/stdc++.h>
using namespace std;
bool solve(string &s, string &t, string &u) {
  int is = 0, it = 0;
  for (int i = (int)(0); i < (int)(u.size()); i++) {
    if (i % 2 == 0) {
      while (is < s.size() && s[is] != u[i]) is++;
      if (is == s.size()) return false;
    } else {
      while (it < t.size() && t[it] != u[i]) it++;
      if (it == t.size()) return false;
    }
  }
  return true;
}
int main() {
  string s, t;
  cin >> s >> t;
  if (solve(s, t, s) || solve(t, s, s))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
