#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}


int main () {
  cin.tie(0);
  cout << setprecision(10);
  
  string s, t; cin >> s >> t;

  bool ans = true;
  string tmpt = t;
  for(int i=0;i<SZ(s);i+=2) {
    while(!t.empty() && !s.empty() && t[0] != s[i]) {
      t = t.substr(1, SZ(t)-1);
    }
    if(t.empty() || s.empty()) {
      ans = false;
      break;
    }
    t = t.substr(1, SZ(t)-1);
  }

  if(ans) {
    cout << "Yes" << endl;
    return 0;
  }

  ans = true;

  t = tmpt;
  for(int i=1;i<SZ(s);i+=2) {
    while(!t.empty() && !s.empty() && t[0] != s[i]) {
      t = t.substr(1, SZ(t)-1);
    }
    if(t.empty() || s.empty()) {
      ans = false;
      break;
    }
    t = t.substr(1, SZ(t)-1);
  }

  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

