#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<char, int>;
const int inf = numeric_limits<int>::max() / 3;
int bit[200010];
int dp[100000000];
int main(void) {
  string s, t;
  cin >> s;
  cin >> t;
  int size = (int)s.size();
  int p = 0;
  for (int i = 0; i < t.size() && p < size; ++i) {
    if (t[i] == s[p]) p += 2;
  }
  if (p >= size) {
    puts("Yes");
    return 0;
  }
  p = 1;
  for (int i = 0; i < t.size() && p < size; ++i) {
    if (t[i] == s[p]) p += 2;
  }
  if (p >= size)
    puts("Yes");
  else
    puts("No");
  return 0;
}
