#include <iostream>
#include <string>

using namespace std;

int main() {
	string s, t; cin >> s >> t;
	string s1, s2;
	for (int i = 0; i < s.size(); ++i) {
		if (i & 1) s1 += s[i];
		else s2 += s[i];
	}
	int now1 = 0, now2 = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (s1[now1] == t[i]) now1++;
		if (s2[now2] == t[i]) now2++;
	}
	if (now1 == s1.size() || now2 == s2.size()) cout << "Yes" << endl;
	else cout << "No" << endl;
	

	return 0;
}
