"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const s = spi[0];
    const t = spi[1];
    const n = s.length;

    for (let i = 0; i < n; i++) {
        if (s[i] !== t[i]) {
            console.log("No");
            return;
        }
    }

    console.log("Yes");
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
