function Main(input){
    input = input.split("\n")
    var s=input[0];
    var t=input[1];
    
    if(s===t.substr(0,s.length)){
    var t_end=t.substr(t.length-1,t.length);
      if(isUpperCase(t_end)===true){
      console.log('Yes');
      }
      else{
      console.log('No');
      }
    }
  else{
    console.log('No');
  }
}
const isUpperCase = c => {
  return /^[a-z]+$/g.test(c)
}        

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());