#include <bits/stdc++.h>
using namespace std;
int main() {
  string S, T;
  cin >> S >> T;
  int i, j;
  for (i = 0, j = 0; i < S.size(); i += 2) {
    while (S[i] != T[j] && j < T.size()) j++;
    if (j == T.size()) break;
  }
  if (i >= S.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  for (i = 1, j = 0; i < S.size(); i += 2) {
    while (S[i] != T[j] && j < T.size()) j++;
    if (j == T.size()) break;
  }
  if (i >= S.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
