"use strict"
function main(arg) {
    let data = arg.trim().split("\n")
    const S = data[0]
    const T = data[1]
    if (T.slice(0, S.length) === S) {
        console.log('Yes')
    } else {
        console.log('No')
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));