#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  int k = 0;
  int sum = 0;
  if ((s.size()) % 2 == 0) {
    for (int i = 1; i < s.size(); i += 2) {
      for (int j = k; j < t.size(); j++) {
        if (s[i] == t[j]) {
          k = j + 1;
          sum++;
          break;
        }
      }
    }
    if (sum == s.size() / 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    for (int i = 0; i < s.size(); i += 2) {
      for (int j = k; j < t.size(); j++) {
        if (s[i] == t[j]) {
          k = j + 1;
          sum++;
          break;
        }
      }
    }
    if (sum == s.size() / 2 + 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
