#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[1001];
  char b[1001];
  scanf("%s", a);
  scanf("%s", b);
  int i, j = 0;
  int f = 0;
  if (strlen(a) % 2 == 1) {
    cout << "No" << endl;
    return 0;
  }
  for (i = 0; i < strlen(a); i += 2) {
    for (; j < strlen(b); j++) {
      if (a[i] == b[j]) break;
    }
    if (strlen(b) == j) f = 1;
  }
  if (f == 1) {
    j = 0;
    for (i = 1; i < strlen(a); i += 2) {
      for (; j < strlen(b); j++) {
        if (a[i] == b[j]) break;
      }
      if (strlen(b) == j) f = 2;
    }
  }
  if (f == 2)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
