#include "bits/stdc++.h"
using namespace std;

int main() {
	string S, T;
	cin >> S >> T;
	string A = "", B = "";
	for (int i = 0; i < S.size(); i++) {
		if (i % 2 == 0) A += S[i];
		else B += S[i];
	}
	int NOW = 0;
	for (int i = 0; i < T.size(); i++) {
		if (NOW == A.size()) break;
		if (A[NOW] == T[i]) NOW++;
	}
	if (NOW == A.size()) {
		cout << "Yes" << endl;
		return 0;
	}
	NOW = 0;
	for (int i = 0; i < T.size(); i++) {
		if (NOW == B.size()) break;
		if (B[NOW] == T[i]) NOW++;
	}
	if (NOW == B.size()) {
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;
}
