#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  string s, t;
  cin >> s >> t;
  bool flag = true;
  int cnt = 0;
  for (int i = 0; i < s.size(); i += 2) {
    while (cnt < t.size() && t[cnt] != s[i]) cnt++;
    if (cnt == t.size()) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  flag = true;
  cnt = 0;
  for (int i = 1; i < s.size(); i += 2) {
    while (cnt < t.size() && t[cnt] != s[i]) cnt++;
    if (cnt == t.size()) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
