def main():

    S=eval(input())

    T=eval(input())

    if S==T[:len(S)]: print('Yes')

    else: print('No')

    return



if __name__=='__main__':

    main()
def main():

    S=eval(input())

    T=eval(input())

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

    else: print('No')

    return



if __name__=='__main__':

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


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

-    if S == T[: len(S)]: +    if S == T[:-1]: