#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  cin >> s >> t;
  int i = 0;
  for (int j = 0; j < t.length(); j++) {
    if (s[i] == t[j]) {
      i += 2;
      if (i >= s.length()) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  i = 1;
  for (int j = 0; j < t.length(); j++) {
    if (s[i] == t[j]) {
      i += 2;
      if (i >= s.length()) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
