def main():

    S = eval(input())

    T = eval(input())

    print(("Yes" if S == T[: len(S)] else "No"))

    return





main()

def main():

    S = eval(input())

    T = eval(input())

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

    return





main()

def main():
    S = eval(input())
    T = eval(input())
    print(("Yes" if S == T[: len(S)] else "No"))
    return


main()

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


main()

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