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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;
  for (int p : {0, 1}) {
    int j = 0;
    for (int i = p; i < (int)s.size(); i += 2) {
      while (j < (int)t.size() and t[j] != s[i]) {
        ++j;
      }
      ++j;
    }
    if (j <= (int)t.size()) {
      cout << "Yes\n";
      exit(0);
    }
  }
  cout << "No\n";
}

