S = eval(input())

T = eval(input())

if S.islower() and T.islower() and len(S) >= 1 and len(S) <= 10 and len(T) == len(S) + 1 and T[:-1] == S:

  print("Yes")

else:

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

T = eval(input())

if S.islower() and T.islower() and T[:-1] == S:

  print("Yes")

else:

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

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

-if ( -    S.islower() -    and T.islower() -    and len(S) >= 1 -    and len(S) <= 10 -    and len(T) == len(S) + 1 -    and T[:-1] == S -): +if S.islower() and T.islower() and T[:-1] == S: