#include <bits/stdc++.h>

using namespace std;

int main(){
  string s, t; cin >> s >> t;
  string res = "Yes";
  for(int i=0; i<s.size(); ++i){
    if(s[i] != t[i]) res = "No";
  }
  cout << res << "\n";
  return 0;
}