#include<bits/stdc++.h>
using namespace std;
#include<string.h>
int main()
{
    string s;
    string t;
    cin >> s;
    cin >> t;
    int n= s.length();
    int k = t.length();
    for(int i = 0;i<n;i++)
    {
        if(s[i] != t[i])
        {
            printf("NO\n");
            return 0;
        }
    }
    if(k > n)
    {
        printf("YES\n");
    }else
    {
        printf("NO\n");
    }
    return 0;
}
