#include <bits/stdc++.h>
using namespace std;

int main(){
    string s, t;
    cin >> s >> t;
    int n = s.size();
    bool ok = false;
    for(int b=0;b<2;b++){
        int i=b;
        for(int j=0;j<n;j++){
            if(i<n && s[i]==t[j]) i+=2;
        }
        ok |= i>=n;
    }
    cout << (ok ? "Yes" : "No") << endl;
    return 0;
}

