process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", input => {
  const inputs = input.split("\n");
  const S = inputs[0];
  const T = inputs[1];
  const result = getResult(S, T);
  console.log(result);
});

const RESULT_OK = "Yes";
const RESULT_NG = "No";

const getResult = (S, T) => {
  const sLength = S.length;
  if (sLength === 0 || sLength > 10) {
    return RESULT_NG;
  }
  if (T.length !== sLength + 1) {
    return RESULT_NG;
  }
  return T.slice(0, sLength) === S ? RESULT_OK : RESULT_NG;
};
