#include <bits/stdc++.h>
using namespace std;
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
signed main() {
  string S, T;
  cin >> S >> T;
  int life = 2;
  int s = 0, t = 0;
  for (int i = (0); i < (S.size()); i++) {
    if (i % 2 == 1)
      while (t < T.size() && S[i] != T[t]) t++;
    else
      while (s < S.size() && S[i] != S[s]) s++;
  }
  if (1) {
    cerr << "s"
         << " " << s << endl;
  };
  if (1) {
    cerr << "t"
         << " " << t << endl;
  };
  if (t == T.size() || s == S.size()) life--;
  s = 0, t = 0;
  for (int i = (0); i < (S.size()); i++) {
    if (i % 2 == 0)
      while (t < T.size() && S[i] != T[t]) t++;
    else
      while (s < S.size() && S[i] != S[s]) s++;
  }
  if (1) {
    cerr << "s"
         << " " << s << endl;
  };
  if (1) {
    cerr << "t"
         << " " << t << endl;
  };
  if (t == T.size() || s == S.size()) life--;
  if (life)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
