function main(input) {
  const args = input.split('\n')
  const s = args[0]
  const t = args[1]
  console.log(t.slice(0, s.length))
  if (t.slice(0, s.length) === s) {
    console.log('Yes')
  } else {
    console.log('No')
  }
    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))