#include <bits/stdc++.h>
const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using namespace std;
long long max(long long a, int b) { return max(a, long long(b)); }
long long max(int a, long long b) { return max(long long(a), b); }
long long min(long long a, int b) { return min(a, long long(b)); }
long long min(int a, long long b) { return min(long long(a), b); }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;
  string tmp;
  for (long long i = 0; i < s.size(); ++i) {
    if (i % 2) tmp += s[i];
  }
  int k = 0;
  for (long long j = 0; j < t.size(); ++j) {
    if (t[j] == tmp[k]) {
      k++;
      if (k == tmp.size()) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  tmp = "";
  for (long long i = 0; i < s.size(); ++i) {
    if (!(i % 2)) tmp += s[i];
  }
  k = 0;
  for (long long j = 0; j < t.size(); ++j) {
    if (t[j] == tmp[k]) {
      k++;
      if (k == tmp.size()) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
