#include<iostream>
#include<iostream>
#include<string>
int main(){
    std::string s1, s2;
    std::cin >> s1 >> s2;
    int result;
    result = s2.compare(0, s1.length(), s1);
    if(result == 0){
        std::cout << "Yes"<< "\n";
    }else{
        std::cout << "No"<< "\n";
    }
    return 0;
}