#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

bool check(string &s, string &t) {
    unsigned int pos = 0;
    REP (i, 0, s.size()) {
        if (s[i] == t[pos]) pos++;
        if (pos == t.size()) return true;
    }
    return false;
}

int main () {
    string S, T;
    cin >> S >> T;
    string subS[2] = {"", ""};
    REP (i, 0, S.size()) {
        subS[i % 2] += S[i];
    }
    cout << (check(T, subS[0]) || check(T, subS[1]) ? "Yes" : "No") << endl;
    return 0;
}