#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
using ll = long long;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s, t; cin >> s >> t;

	bool ok = false;
	int n = s.size(), m = t.size();

	int idx = 1;
	for (int i = 0; i < m; ++i) {
		if (idx >= n) {
			ok = true;
			break;
		}
		if (t[i] == s[idx]) {
			idx += 2;
		}
	}

	idx = 0;
	for (int i = 0; i < m; ++i) {
		if (idx >= n) {
			ok = true;
			break;
		}
		if (t[i] == s[idx]) {
			idx += 2;
		}
	}
	if (ok) cout << "Yes" << endl;
	else cout << "No" << endl;

	int c;  cin >> c;
	return 0;

}
