#include <bits/stdc++.h>
using namespace std;
bool contain(string a, string b) {
  long long now = 0;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] == b[now]) {
      now++;
      if (now == b.size()) return true;
    }
  }
  return false;
}
signed main() {
  string s, t;
  cin >> s >> t;
  string s1 = "", s2 = "";
  for (long long i = 0; i < s.size(); i++) {
    if (i % 2 == 0)
      s1 += s[i];
    else
      s2 += s[i];
  }
  if (contain(t, s1) || contain(t, s2))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
