#include <iostream>
using namespace std;

int main()
{
  string S, T, p[2];
  cin >> S >> T;
  p[0] = p[1] = "";
  for(int i = 0; i < S.size(); i += 2){
    p[0] += S[i];
    if(i+1 < S.size()) p[1] += S[i+1];
  }
  for(int i = 0; i < 2; i++){
    for(int j = 0, Sp = 0; j < T.size(); j++){
      if(p[i][Sp] == T[j]) Sp++;
      if(Sp == p[i].size()){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}