S=str(eval(input()))

B=str(eval(input()))

if B[:-1:]==S:

    print('Yes')

else:

    print('No')
S1=str(eval(input()))

S2=str(eval(input()))

ans=0

for i in range(len(S1)):

  if S1[i]!=S2[i]:

    ans=1

if ans==1:

  print('No')

else:

  print('Yes')
S = str(eval(input()))
B = str(eval(input()))
if B[:-1:] == S:
    print("Yes")
else:
    print("No")

S1 = str(eval(input()))
S2 = str(eval(input()))
ans = 0
for i in range(len(S1)):
    if S1[i] != S2[i]:
        ans = 1
if ans == 1:
    print("No")
else:
    print("Yes")

-S = str(eval(input())) -B = str(eval(input())) -if B[:-1:] == S: +S1 = str(eval(input())) +S2 = str(eval(input())) +ans = 0 +for i in range(len(S1)): +    if S1[i] != S2[i]: +        ans = 1 +if ans == 1: +    print("No") +else: -else: -    print("No")