#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    string S,T; cin >> S >> T;
    
    bool ok = false;
    string O;

    auto f = [&]{
        if(O == "") return true;
        
        int Oidx = 0;
        for(int i = 0 ; i < T.length(); i++){
            while(T[i]!=O[Oidx] && i < T.length()) i++;
            if(i >= T.length()) break;
            Oidx++;
            if(Oidx == (int)O.length()){
                return true;
            }
        }
        return false;
    };

    for(int i = 0; i < S.length(); i+=2) O += S[i];
    
    ok |= f();
    
    O = "";
    for(int i = 1; i < S.length(); i+=2) O += S[i];
    ok |= f();
    
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

