#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef vector<vector<int,int>> VII;
typedef pair<int,pair<int,int>> PII;

#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define repa(i,a,n) for(ll i=a;i<n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pera(i,a,n) for(ll i=a;i>=n;i--)
#define per(i,n) for(ll i=n;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define MS0(x) memset((x), 0, sizeof((x)))
#define MS1(x) memset((x), -1, sizeof((x)))
#define MEM(a, b) memset(a, b, sizeof(a))
#define SZ(x) ((ll)(x).size())
#define TIME    cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

const ll mod=1e9+7;
const double pi=acos(-1);

ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
ll power(ll a,ll b,ll p) //log(n)
{
    if(b==0) return 1;
    ll c = power(a,b/2,p);
    if(b%2==0) return (c*c)%p;
    else return (((c*c)%p)*a)%p;
}
ll inv(ll n, ll p){ return power(n,p-2, p); }
bool isPrime(ll n) {
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (ll i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
            return false;
    return true;
}


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    string s,t;
    int l=SZ(s);
    int lp=SZ(t);
    if(lp!=l+1) cout<<"NO";
    else
    {
        if(t.substr(0,l)!=s)cout<<"NO";
        else cout<<"YES";
    }
    return 0;
}
