#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll long long
string a,b;
char t[1000];
int main(){
cin>>a>>b;
int as=a.size(),bs=b.size();
int num=as/2,pos=0;
bool ok=0;

for(int k=0;k<2;k++){
pos=0;
rep(l,1000)t[l]='';

for(int i=k;i<as;i+=2){
	if(i>=bs){ok=0;break;}
	t[pos++]=a[i];
}

for(int i=0;i<bs;i++){
	int c=0;
	if(b[i]==t[c]){
		for(int j=i;j<bs;j++){
			if(b[j]==t[c])c++;
		}
		if(c==pos)ok=1;
	}

}

}
if(ok)cout<<"Yes"<<endl;
else cout<<"No"<<endl;

	return 0;
}
