#include <bits/stdc++.h>
using namespace std;
string a, b;
char t[2000];
int main() {
  cin >> a >> b;
  int as = a.size(), bs = b.size();
  int num = as / 2, pos = 0;
  bool ok = 0, ok2;
  for (int k = 0; k < 2; k++) {
    pos = 0;
    for (int l = 0; l < 2000; l++) t[l] = ' ';
    for (int i = k; i < as; i += 2) {
      t[pos++] = a[i];
    }
    for (int i = 0; i < bs; i++) {
      int c = 0;
      if (b[i] == t[c]) {
        for (int j = 0; j < bs; j++) {
          if (b[j] == t[c]) c++;
        }
        if (c == pos) ok = 1;
      }
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
