#include<bits/stdc++.h>
using namespace std;
string S,T;
int dp[1005][1005];
int solve(string a,string b){
  int A=a.size(),B=b.size();
  memset(dp,0,sizeof(dp));
  for(int i=0;i<A;i++){
    for(int j=0;j<B;j++){
      if(a[i]==b[j]){
        dp[i+1][j+1]=dp[i][j]+1;
      }else{
        dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1]);
      }
    }
  }
  return dp[A][B];
}
 
int main(){
  cin>>S>>T;
  string sa="",sb="";
  for(int i=0;i<(int)S.size();i++){
    if(i%2==0)sa.push_back(S[i]);
    else sb.push_back(S[i]);
  }
  if( solve(sa,T) == (int)sa.size() )cout<<"Yes"<<endl;
  else if( solve(sb,T) == (int)sb.size() )cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}