#include <bits/stdc++.h>
using namespace std;
bool chk(string a, string b, int s) {
  int i;
  string buf = b;
  char tg;
  for (i = s; i < a.size(); i += 2) {
    tg = a[i];
    auto idx = find(buf.begin(), buf.end(), tg);
    if (idx != buf.end()) {
      *idx = '.';
    } else {
      return false;
    }
  }
  return true;
}
int main() {
  int i, iss;
  string a, b;
  cin >> a;
  cin >> b;
  iss = 1;
  if (!chk(a, b, 0)) {
    iss = 0;
  }
  if (!iss && chk(a, b, 1)) {
    iss = 1;
  }
  if (iss) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
