from sys import stdin

def main():

    #入力

    readline=stdin.readline

    S=readline().strip()

    T=readline().strip()

    for i in range(len(S)):

        if S[i]!=T[i]:

            print("No")

            break

    else:

        print("Yes")

if __name__=="__main__":

    main()
s=eval(input())

t=eval(input())

print(("Yes" if s==t[:-1] else "No"))
from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    S = readline().strip()
    T = readline().strip()
    for i in range(len(S)):
        if S[i] != T[i]:
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

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

-from sys import stdin - - -def main(): -    # 入力 -    readline = stdin.readline -    S = readline().strip() -    T = readline().strip() -    for i in range(len(S)): -        if S[i] != T[i]: -            print("No") -            break -    else: -        print("Yes") - - -if __name__ == "__main__": -    main() +s = eval(input()) +t = eval(input()) +print(("Yes" if s == t[:-1] else "No"))