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

int main()
{
    int n1,n2,flag,i;
    string s,t;
    cin>>s;
    cin>>t;
    flag=0;
    n1=(int)(s.length());
    n2=(int)(t.length());
    if (n1<1 || n1>10 || n2-n1!=1) flag=1;
    for ( i = 0; i < n1; i++)
    {
        if (s[i]!=t[i])
        {
            flag=1;
            break;
        }
    }
    if (flag==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}