#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0;
  string s1, s2, s3;
  cin >> s1 >> s2;
  s3 = s1;
  for (int i = 0; i < s2.size(); i++) {
    for (int j = 1; j < s1.size(); j += 2) {
      if (s2[i] == s1[j]) {
        s1[j] = ' ';
        c++;
        break;
      }
    }
  }
  if (c >= s1.size() / 2) {
    cout << "Yes" << endl;
    goto L;
  }
  c = 0;
  for (int i = 0; i < s2.size(); i++) {
    for (int j = 0; j < s3.size(); j += 2) {
      if (s2[i] == s3[j]) {
        s3[j] = ' ';
        c++;
        break;
      }
    }
  }
  if (c >= (s1.size() + 1) / 2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
L:;
}
