#include<bits/stdc++.h>
using namespace std;
bool solve(string a,string b){
    int pos=0;
    for(int i=0;i<b.length();++i){
	if(a[pos]==b[i]) ++pos;
	if(pos==a.length()) return true;
    }
    return false;
}
int main(){
    string s,t,s1,s2; cin>>s>>t;
    for(int i=0;i<s.size();++i){
	if(i%2==0) s1+=s[i];
	else s2+=s[i];
    }
    cout<<(solve(s1,t)||solve(s2,t)?"Yes":"No")<<endl;
    return 0;
}
