#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
struct UnionFind {
  vector<int> v;
  UnionFind(int n) : v(n) {
    for (int i = 0; i < n; i++) v[i] = i;
  }
  int find(int x) { return v[x] == x ? x : v[x] = find(v[x]); }
  void unite(int x, int y) { v[find(x)] = find(y); }
};
int main() {
  string s, t;
  string s1, s2, t1;
  cin >> s >> t;
  for (int i = 0; i < (int)(s.length()); ++i)
    if (i % 2 == 0)
      s1 += s[i];
    else
      s2 += s[i];
  bool clear1 = true;
  bool clear2 = true;
  int idx = 0;
  for (int i = 0; i < (int)(s1.size()); ++i) {
    if (t.find(s1[i], idx) != string::npos) {
      idx = t.find(s1[i], idx) + 1;
    } else {
      clear1 = false;
      break;
    }
  }
  idx = 0;
  for (int i = 0; i < (int)(s2.size()); ++i) {
    if (t.find(s2[i], idx) != string::npos) {
      idx = t.find(s2[i], idx) + 1 + 1;
    } else {
      clear2 = false;
      break;
    }
  }
  if (clear1 || clear2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
