s = eval(input())

t = eval(input())

for i in range(26):

    if s + chr(i + ord('a')) == t:

        print('Yes')

        break

else:

    print('No')

s = eval(input())

t = eval(input())

if s == t[:-1]:

    print('Yes')

else:

    print('No')

s = eval(input())
t = eval(input())
for i in range(26):
    if s + chr(i + ord("a")) == t:
        print("Yes")
        break
else:
    print("No")

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

-for i in range(26): -    if s + chr(i + ord("a")) == t: -        print("Yes") -        break +if s == t[:-1]: +    print("Yes")