#include <bits/stdc++.h>
using namespace std;
int main() {
  int c1 = 0, c2 = 0, c3 = 0;
  string s, t, p1, p2;
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++)
    if (i % 2)
      p1 += s[i];
    else
      p2 += s[i];
  for (int j = 0; j < p1.size(); j++) {
    int c = 0;
    for (int i = c1; i < t.size(); i++)
      if (t[i] == p1[j]) {
        c1 = i + 1, c++, c3++;
        break;
      }
  }
  if (c3 == p1.size()) goto M;
  for (int j = 0; j < p2.size(); j++) {
    int c = 0;
    for (int i = c2; i < t.size(); i++)
      if (t[i] == p1[j]) {
        c2 = i + 1, c++;
        break;
      }
    if (!c) goto L;
  }
M:
  cout << "Yes" << endl;
  if (0)
  L:
    cout << "No" << endl;
}
