#include <bits/stdc++.h>

using namespace std;

bool check(string s, string t) {
  if (s == "") return true;
  int tt = 0, sz = s.size(), tz = t.size();
  for (int i = 0; i < sz; i++, tt++) {
    while (tt < tz && t[tt] != s[i]) tt++;
    if (tt == tz) break;
    if (i == sz - 1) return true;
  }
  return false;
}

int main(void) {
  string s, t;
  cin >> s >> t;

  int sz = s.size();
  bool yes = false;
  string p = "", q = "";
  for (int i = 0; i < sz; i++) {
    if (i & 1) q += s[i];
    else p += s[i];
  }
  yes |= check(p, t) || check(q, t);

  cout << (yes ? "Yes" : "No") << endl;

  return 0;
}
