#include <bits/stdc++.h>


using namespace std;


// Powered by caide (code generator, tester, and library code inliner)


class Solution {
public:
  string S, T;
  bool enough1()
  {
    size_t pos = 0;
    for (int i = 0; i < S.size(); i += 2) {
      pos = T.find_first_of(S[i], pos);
      if(pos == string::npos) {
        return false;
      }
      pos++;
    }
    return true;
  }

  bool enough2()
  {
    size_t pos = 0;
    for (int i = 1; i < S.size(); i += 2) {
      pos = T.find_first_of(S[i], pos);
      if (pos == string::npos) {
        return false;
      }
      pos++;
    }
    return true;
  }

  void solve(std::istream& in, std::ostream& out)
  {
    in >> S >> T;
    if(enough1() || enough2()) {
      out << "Yes\n";
    } else {
      out << "No\n";
    }
  }
};

void solve(std::istream& in, std::ostream& out)
{
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}


#include <fstream>
#include <iostream>


int main() {
  
  ios_base::sync_with_stdio(0);
  cin.tie(0);


  istream& in = cin;


  ostream& out = cout;

  solve(in, out);
  return 0;
}