"use strict"
function main(arg) {

    if(arg.trim().split("\n")[0] === arg.trim().split("\n")[1].substr( 0, arg.trim().split("\n")[0].length)){
        console.log("Yes");
    }
    else{
        console.log("No");

    }

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