#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;
const int inf = 1 << 25;
const ll INF = 1LL << 55;
int main() {
  string second, T;
  cin >> second >> T;
  string odd, even;
  odd = even = "";
  for (int i = 0; i < (int)(second.size()); i++)
    (i % 2 ? odd : even) += second[i];
  int idx = 0;
  for (int i = 0; i < (int)(T.size()); i++) {
    if (idx == (int)odd.size()) break;
    if (T[i] == odd[idx]) idx++;
  }
  if (idx == (int)odd.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  idx = 0;
  for (int i = 0; i < (int)(T.size()); i++) {
    if (idx == (int)even.size()) break;
    if (T[i] == even[idx]) idx++;
  }
  if (idx == (int)even.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
