S=eval(input())

T=eval(input())

ans='No'

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

    ans='Yes'

print(ans)
S=eval(input())

T=eval(input())



if T[0:-1]==S:

    print('Yes')

else:

    print('No')
S = eval(input())
T = eval(input())
ans = "No"
if S.islower() and T.islower() and 1 <= len(S) <= 10 and T[0 : len(S)] == S:
    ans = "Yes"
print(ans)

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

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