#include<iostream>
#include<string>
using namespace std;

int main(void){
    string s,t;
    cin >> s >> t;
    for(int i = 0;i < s.size();i++){
        if(s.at(i) != t.at(i)){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}
