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