const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
S = input[0]
T = input[1]
// console.log(`S=${S}`)
// console.log(`T=${T}`)

if (T.indexOf(S) === -1) {
    console.log(`No`)
} else {
    console.log(`Yes`)
}