#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
const int INF = 100000000;
using namespace std;


bool solve(string s, string t, int SorT){
    int sp, tp, p;
    bool ans = false;
    sp = tp = p = 0;

    while(sp < s.size() && tp < t.size()){
        if(SorT == 0){
            if(s[sp] == s[p]){
                p++;
                SorT = 1;
            }
            sp++;
        }else{
            if(t[tp] == s[p]){
                p++;
                SorT = 0;
            }
            tp++;
        }
        if(p == s.size()){
            ans = true;
            break;
        }
    }
    return ans;
}

int main(){
    string s, t;
    cin >> s >> t;

    if(solve(s, t, 0) ||  solve(s, t, 1)) cout << "Yes" << endl;
    else cout << "No" << endl;
}