#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string S, T; cin >> S >> T;
	string s[2];
	rep(i, S.size())s[i & 1] += S[i];
	rep(i, 2) {
		int d = 0;
		rep(j, s[i].size()) {
			d = (int)T.find(s[i][j], d) + 1;
			if (!d)goto g;
		}
		puts("Yes"); return 0;
	g:;
	}
	puts("No");
}