#include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

int MOD=1e9+7;
ll INF=1e18;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    string s, t; cin>>s>>t;
    int n=s.size(), m=t.size();
    int j=0;
    bool iseven=true, isodd=true;
    for(int i=0; i<n; i++){ // S even
        if(i%2==0) continue;
        while(j<m){
            if(s[i]==t[j]){
                j++;
                if(j==m){
                    iseven=false;
                    goto END1;
                }
                break;
            }
            j++;
            if(j==m){
                iseven=false;
                goto END1;
            }
        }
    }
    END1:;
    
    j=0;
    for(int i=0; i<n; i++){ // S odd
        if(i%2==1) continue;
        while(j<m){
            if(s[i]==t[j]){
                j++;
                if(j==m){
                    isodd=false;
                    goto END2;
                }
                break;
            }
            j++;
            if(j==m){
                isodd=false;
                goto END2;
            }
        }
    }
    END2:;
    //cout << iseven << " " << isodd << endl;
    if(iseven || isodd) cout << "Yes" << endl;
    else cout << "No" << endl;
}
