#include <iostream>
#include <string>
using namespace std;

bool check(string T, string sub) {
    int it = 0;
    for (int i = 0; i < T.size(); ++i) {
        if (T[i] == sub[it]) ++it;
        if (it == sub.size()) break;
    }
    return (it == sub.size());
}

int main() {
    string S, T; cin >> S >> T;
    bool ok = false;
    for (int start = 0; start < 2; ++start) {
        string sub = "";
        for (int cur = start; cur < S.size(); cur += 2) sub += S[cur];
        if (check(T, sub)) ok = true;
    }
    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}
