#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;


int main(){

	int s_len,t_len,s_index,t_index;
	char S[1001],T[1001];

	scanf("%s",S);
	scanf("%s",T);

	for(s_len = 0;S[s_len] != '\0';s_len++);
	for(t_len = 0;T[t_len] != '\0';t_len++);

	for(s_index = 1,t_index = 0;s_index < s_len && t_index < t_len; s_index += 2){
		for(;t_index < t_len && T[t_index] != S[s_index];t_index++);
		if(t_index == t_len)break;
		t_index += 1;
	}
	if((s_len%2 == 1 && s_index == s_len) || (s_len%2 == 0 && s_index > s_len)){
		printf("Yes\n");
		return 0;
	}

	for(s_index = 0,t_index = 0;s_index < s_len && t_index < t_len; s_index += 2){
		for(;t_index < t_len && T[t_index] != S[s_index];t_index++);
		if(t_index == t_len)break;
		t_index += 1;
	}
	if((s_len %2 == 1 &&  s_index > s_len) || (s_len%2 == 0 && s_index == s_len)){
		printf("Yes\n");
		return 0;
	}

	printf("No\n");

	return 0;
}