#!/usr/bin/env python3





def main():

    S = eval(input())

    T = eval(input())

    if S == T[:len(S)]:

        print('Yes')

    else:

        print('No')



main()

#!/usr/bin/env python3





def main():

    S = eval(input())

    T = eval(input())

    if S == T[:len(S)]:

        print('Yes')

    else:

        print('No')



if __name__ == "__main__":

    main()

#!/usr/bin/env python3
def main():
    S = eval(input())
    T = eval(input())
    if S == T[: len(S)]:
        print("Yes")
    else:
        print("No")


main()

#!/usr/bin/env python3
def main():
    S = eval(input())
    T = eval(input())
    if S == T[: len(S)]:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

-main() +if __name__ == "__main__": +    main()