#include <bits/stdc++.h>
using namespace std;
bool IsSubsequence(string s, string t) {
  int j = 0;
  for (int i = 0; i < s.size(); i++) {
    while (j < t.size() && s[i] != t[j]) {
      j++;
    }
    if (j == t.size()) {
      return false;
    }
  }
  return true;
}
int main() {
  string s, t;
  cin >> s >> t;
  string a, b;
  for (int i = 0; i < s.size(); i += 2) {
    a += s[i];
  }
  for (int i = 1; i < s.size(); i += 2) {
    b += s[i];
  }
  if (IsSubsequence(a, t) || IsSubsequence(b, t)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
