#include <iostream>
#include <string>
using namespace std;
int main(){
  string S, T;
  cin >> S >> T;
  int l = S.size();
  string s[2];
  for(int i = 0; i < l; ++i)
    s[i%2] += S[i];
  for(int i = 0; i < 2; ++i){
    int k = 0;
    for(int j = 0; j < l; ++j){
      if(s[i][k] == T[j]) ++k;
      if(k == s[i].size()){
	cout << "Yes" << endl;
	return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}