#include <bits/stdc++.h>
using namespace std;
int main() {
  string S, T, p[2];
  cin >> S >> T;
  p[0] = p[1] = "";
  for (int i = 0; i < S.size(); i += 2) {
    p[0] += S[i];
    if (i + 1 < S.size()) p[1] += S[i + 1];
  }
  cout << p[0] << " " << p[1] << endl;
  for (int i = 0; i < 2; i++) {
    int c = 0;
    for (int l = 0; l <= T.size() / 2; l++) {
      for (int j = l; j < T.size(); j++) {
        for (int k = 0; k < p[i].size(); k++) {
          if (T[j] == p[i][k]) c++;
          if (c == p[i].size()) {
            cout << "Yes" << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "No" << endl;
}
