/*  -*- coding: utf-8 -*-
 *
 * 2727.cc: M and A
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

bool check(string &s, string &t, int st) {
  int sn = s.size(), tn = t.size();
  for (int i = st, j = 0; i < sn; i += 2) {
    while (j < tn && s[i] != t[j]) j++;
    if (j >= tn) return false;
    j++;
  }
  return true;
}

/* main */

int main() {
  string s, t;
  cin >> s >> t;

  if (check(s, t, 0) || check(s, t, 1)) puts("Yes");
  else puts("No");
  return 0;
}