#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	string s, t, T;
	cin >> s >> t;
	T = s;

	for(int loop = 0; loop < 2; loop++){
		int n1 = 0, n2 = 0;
		bool ok = true;
		for(int i = 0; i < T.size(); i++){
			if(i % 2 == 0){
				while(n1 < s.size() && s[n1] != T[i]) n1++;
				if(n1 == s.size()){
					ok = false;
					break;
				}
				n1++;
			}
			else{
				while(n2 < t.size() && t[n2] != T[i]) n2++;
				if(n2 == t.size()){
					ok = false;
					break;
				}
				n2++;
			}
		}
		if(ok){
			cout << "Yes" << endl;
			return 0;
		}
		swap(s, t);
	}
	cout << "No" << endl;
}