#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600
#define long long long

bool solve(string &s, string &t, string &u){
  // s?????????????§??????????u????????????
  int is=0, it=0;
  rep(i,u.size()){
    if(i%2==0){
      while(is < s.size() && s[is]!=u[i]) is++;
      if(is == s.size()) return false;
      is++;
    } else {
      while(it < t.size() && t[it]!=u[i]) it++;
      if(it == t.size()) return false;
      it++;
    }
  }
  return true;
}

int main(){
  string s,t;
  cin>>s>>t;

  if(solve(s,t,s) || solve(t,s,s)) cout<<"Yes"<<endl;
  else cout << "No"<<endl;

  return 0;
}