#include <bits/stdc++.h>
using namespace std;
int main()
{
string s,t;
cin >> s >> t;
bool ok = true;
for (int i=0; i<s.length(); i++)
    {
        if (s[i]!=t[i]) {cout << "No"; return 0;}
    }

cout << "Yes";


}
