#include <bits/stdc++.h>
using namespace std;
bool issubseq(string S, string T){
  T += '#';
  int p = 0;
  int N = S.size();
  for (int i = 0; i < N; i++){
    if (S[i] == T[p]){
      p++;
    }
  }
  return p + 1 == T.size();
}
int main(){
  string S;
  cin >> S;
  string T;
  cin >> T;
  int N = S.size();
  string s1, s2;
  for (int i = 0; i < N; i++){
    if (i % 2 == 0){
      s1 += S[i];
    }
    if (i % 2 == 1){
      s2 += S[i];
    }
  }
  if (issubseq(T, s1) || issubseq(T, s2)){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
