#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define Get(t, i) get<(i)>((t))
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

const int inf = 1 << 25;
const ll INF = 1LL << 55;

int main()
{
  string S, T;
  cin >> S >> T;
  string odd, even;
  odd = even = "";
  rep(i, S.size()) (i%2 ? odd : even) += S[i];
  int idx = 0;
  rep(i, T.size()) {
    if(idx == (int)odd.size()) break;    
    if(T[i] == odd[idx]) idx++;
  }
  if(idx == (int)odd.size()) {
    cout << "Yes" << endl;
    return 0;
  }
  idx = 0;
  rep(i, T.size()) {
    if(idx == (int)even.size()) break;
    if(T[i] == even[idx]) idx++;
  }
  if(idx == (int)even.size()) {
    cout << "Yes" << endl;
    return 0;
  } 
  cout << "No" << endl;
  return 0;
}