#include <bits/stdc++.h>
using std::cin;
using std::complex;
using std::cout;
using std::endl;
using std::fixed;
using std::lower_bound;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::setprecision;
using std::sort;
using std::stack;
using std::stoi;
using std::stoll;
using std::string;
using std::to_string;
using std::tuple;
using std::upper_bound;
using std::vector;
template <typename T>
using Vec = vector<T>;
bool check(string str, string tar) {
  int lens = str.length();
  int lent = tar.length();
  int str_index = 0;
  int tar_index = 0;
  while (1) {
    if (tar_index == lent) {
      return true;
    } else if (str_index == lens) {
      return false;
    }
    if (str[str_index] == tar[tar_index]) {
      tar_index++;
    }
    str_index++;
  }
}
int main(void) {
  string s;
  string t;
  cin >> s >> t;
  int slen = s.length();
  string odd = "";
  string even = "";
  for (int i = 0; i < slen; i++) {
    if ((i + 1) % 2 == 1) {
      odd += s[i];
    } else {
      even += s[i];
    }
  }
  if ((check(s, odd) == true && check(t, even) == true) ||
      (check(s, odd) == true && check(t, even) == true)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
