#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define int long long
const int MOD=1e9+7;
const int N=3e5+10;
int32_t main()
{
    IOS;
    string s,a;
    cin>>s>>a;
    int ok=0;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]!=a[i])
            ok=1;
    }
    if(ok)
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;


}