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