#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
int main() {
  string S, T;
  cin >> S >> T;
  bool ans = false;
  {
    bool ok = true;
    int now = 0;
    for (int i = 0; i < S.size(); i += 2) {
      int next = T.find(S[i], now);
      if (next == string::npos) {
        break;
        ok = false;
      }
      now = next + 1;
    }
    if (ok) ans = true;
  }
  {
    bool ok = true;
    int now = 0;
    for (int i = 1; i < S.size(); i += 2) {
      int next = T.find(S[i], now);
      if (next == string::npos) {
        break;
        ok = false;
      }
      now = next + 1;
    }
    if (ok) ans = true;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
