const main = stdin => {
  const [S, T] = stdin.trim().split('\n')
  if (S === T.substr(0, S.length)) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
