// ABC167 - A
function main(input) {
  var inputs = input.split('\n');
  var s = inputs[0].split('');
  var t = inputs[1].split('');

  for (var i = 0; i < s.length; i++) {
    if (s[i] != t[i]) {
      console.log('No');
      return;
    }
  }
  console.log('Yes');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
