#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 60) - 1;
const long long MOD = 1e9 + 7;
string s, t;
int main() {
  cin >> s >> t;
  string u, v;
  for (int i = 0; i < (s.size()); i++) {
    if (i % 2 == 0)
      u += s[i];
    else
      v += s[i];
  }
  int now = 0;
  int cnt = 0;
  for (int i = 0; i < (u.size()); i++) {
    for (int j = (now + 1); j < (t.size()); j++) {
      if (t[j] == u[i]) {
        cnt++;
        now = j;
        break;
      }
    }
  }
  if (cnt == u.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  now = 0;
  cnt = 0;
  for (int i = 0; i < (v.size()); i++) {
    for (int j = (now + 1); j < (t.size()); j++) {
      if (t[j] == v[i]) {
        cnt++;
        now = j;
        break;
      }
    }
  }
  if (cnt == v.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
