#include <bits/stdc++.h>
 
using namespace std;
 
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
signed main()
{
    string a, b;
    cin >> a >> b;

    int ans = 0;

    string odd, even;

    rep(i, a.size()) {
        if (i % 2) {
            odd.pb(a[i]);
        } else {
            even.pb(a[i]);
        }
    }

    int pt = 0;
    rep(i, b.size()) {
        if (b[i] == odd[pt]) {
            pt++;
        }
        if (pt == odd.size()) {
            break;
        }
    }
    if (pt == odd.size()) {
        cout << "Yes" << endl;
        return 0;
    }

    pt = 0;
    rep(i, b.size()) {
        if (b[i] == even[pt]) {
            pt++;
        }
        if (pt == even.size()) {
            break;
        }
    }
    if (pt == even.size()) {
        cout << "Yes" << endl;
        return 0;
    } else {
        cout << "No" << endl;
    }

    return 0;
}