#include "iostream"
#include "string"
using namespace std;
int main()
{
    string s,t;
    cin>>s>>t;
    
    s= s+ t[t.size()-1];
    
    if(s==t)
    { cout<<"Yes"<<endl;
    
    }
    else
        cout<<"NO"<<endl;
    
    
}
