s = eval(input())

t = eval(input())

print(((t == s+t[-1])*'Yes' + (t != s+t[-1])*'No'))
s = input()

t = input()

print('Yes') if t == s+t[-1] else print('No')

s = eval(input())
t = eval(input())
print(((t == s + t[-1]) * "Yes" + (t != s + t[-1]) * "No"))

s = input()
t = input()
print("Yes") if t == s + t[-1] else print("No")

-s = eval(input()) -t = eval(input()) -print(((t == s + t[-1]) * "Yes" + (t != s + t[-1]) * "No")) +s = input() +t = input() +print("Yes") if t == s + t[-1] else print("No")