import string



S = eval(input())

T = eval(input())



for a in string.ascii_lowercase:

    if S + a == T:

        print('Yes')

        exit()



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

T = eval(input())



print(('Yes' if S == T[:-1] else 'No'))

import string

S = eval(input())
T = eval(input())
for a in string.ascii_lowercase:
    if S + a == T:
        print("Yes")
        exit()
print("No")

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

-import string - -for a in string.ascii_lowercase: -    if S + a == T: -        print("Yes") -        exit() -print("No") +print(("Yes" if S == T[:-1] else "No"))