#include <bits/stdc++.h>
using namespace std;
int lcs(string X, string Y) {
  int c[1050 + 1][1050 + 1];
  int m = X.size();
  int n = Y.size();
  int maxl = 0;
  X = ' ' + X;
  Y = ' ' + Y;
  for (int i = 1; i <= m; i++) c[i][0] = 0;
  for (int j = 1; j <= n; j++) c[0][j] = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (X[i] == Y[j])
        c[i][j] = c[i - 1][j - 1] + 1;
      else
        c[i][j] = max(c[i - 1][j], c[i][j - 1]);
      maxl = max(maxl, c[i][j]);
    }
  }
  return maxl;
}
int main() {
  string s, t, b;
  cin >> s >> t;
  int i;
  bool f = 0;
  for (i = 0; i < s.size(); i++)
    if (i % 2 == 1) b += s[i];
  f |= lcs(b, t) == b.size();
  b = "";
  for (i = 0; i < s.size(); i++)
    if (i % 2 == 0) b += s[i];
  f |= lcs(b, t) == b.size();
  b = "";
  cout << (f ? "Yes" : "No") << endl;
  return 0;
}
