#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define first fi;
#define second se;
using namespace std;
typedef pair<int, int> P;

bool contain(string a, string b){
    int now = 0;
    rep(i, 0, a.size()){
        if(a[i] == b[now]){
            now++;
            if(now == b.size()) return true;
        }
    }
    return false;
}

signed main(){
    string s, t;
    cin >> s >> t;
    string s1 = "", s2 = "";
    rep(i, 0, s.size()){
        if(i % 2 == 0) s1 += s[i];
        else s2 += s[i];
    }
    if(contain(t, s1) || contain(t, s2) || s.size() == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}