#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    string t;
    int i,j=0;
    cin>>s>>t;
    int len1=s.length();
    int len2=t.length();
    for(i=0;i<len1;i++)
    {
        if(s[i]==t[i])
           j++;
    }
    if(j==len1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

}
