#!/usr/bin/env python

import sys
import math
import itertools as it
from collections import deque

sys.setrecursionlimit(10000000)

S_ = raw_input()
T_ = raw_input() + " "

S1 = S2 = ''
for i in range(len(S_)):
    if i % 2 == 0:
        S1 += S_[i]
    else:
        S2 += S_[i]

for S in [S1, S2]:
    T = T_
    for c in S:
        index = T.find(c)
        if index == -1:
            T = ""
            break
        T = T_[index + 1:]
    
    if T != "":
        print "Yes"
        exit()
print "No"
