#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
const double EPS = 1e-9;
int main() {
  string s, t;
  cin >> s >> t;
  int len = s.length();
  bool f = false;
  int now = 0;
  for (int i = 0; i < len; i += 2) {
    while (now < len && s[i] != t[now]) {
      now++;
    }
  }
  if (now < len) f = true;
  now = 0;
  for (int i = 1; i < len; i += 2) {
    while (now < len && s[i] != t[now]) now++;
  }
  if (now < len) f = true;
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
