import 'dart:io';
 
void main(List<String> args) {
  String S = stdin.readLineSync();
  String T = stdin.readLineSync();
  String ans = "Yes";
  for(int i=0; i<S.length; ++i){
  	if(S[i]!=T[i]){
      ans = "No";
      break;
    }
  }
  print(ans);
}