S=eval(input(""))

T=eval(input(""))

l=len(S)

if 1<=l and l<=10 and S.islower()==True and S==T[:-1]:

  print("Yes")

else:

    print("No")
S=eval(input())

T=eval(input())

l=len(S)

if S==T[:-1] and S.islower()==True and 1<=l and l<=10:

  print("Yes")

else:

  print("No")
S = eval(input(""))
T = eval(input(""))
l = len(S)
if 1 <= l and l <= 10 and S.islower() == True and S == T[:-1]:
    print("Yes")
else:
    print("No")

S = eval(input())
T = eval(input())
l = len(S)
if S == T[:-1] and S.islower() == True and 1 <= l and l <= 10:
    print("Yes")
else:
    print("No")

-S = eval(input("")) -T = eval(input("")) +S = eval(input()) +T = eval(input()) -if 1 <= l and l <= 10 and S.islower() == True and S == T[:-1]: +if S == T[:-1] and S.islower() == True and 1 <= l and l <= 10: