/* HARDWORK IS THE KEY TO SUCCESS.
   RATING IS TEMPORARY , KNOWLEDGE IS PERMANENT.!!!*/
#include <bits/stdc++.h>
#define pragma
using namespace std;
#define ll long long
#define ld long double
#define T ll t = 1; cin>>t; while(t--)
#define vin ll n; cin>>n; vector<ll>x(n); for(ll i=0; i<n; i++) cin>>x[i]
#define vout for(ll i=0; i<n; i++) cout<<x[i]<<" "
#define ain ll n,k,i; cin>>n; ll a[n]; for( i=0; i<n; i++) cin>>a[i]
#define aout for(ll i=0; i<n; i++) cout<<a[i]<<" "
#define matin ll m,n; cin >> n >> m; ll a[n + 1][m + 1] ; for(ll i=1;i<=n;i++) for(ll j=1;j<=m;j++) cin>>a[i][j];
#define matout for(ll i=0;i<m;i++){for(ll j=0;j<n;j++) cout<<a[i][j]<<" "; cout<<"\n";}
#define sin set<ll>s; ll n; cin>>n; ll tmp; for(ll i=0;i<n;i++){cin>>tmp; s.I(tmp);}
#define sout for(auto it=s.begin();it!=s.end();++it) cout<<*it<<" "
#define F first
#define S second
#define I insert
#define pb push_back
#define ppb pop_back
#define AISORT sort(a,a+n)
#define ADSORT sort(a,a+n,greater<ll>())
#define VISORT sort(x.begin(),x.end())
#define VDSORT sort(x.begin(),x.end(),greater<ll>())

const ll maxs = 3e5+3;
const ll maxs1 = 1e3+4;
const ll mod = 1e9 + 7;

//MODULO OPEARTIONS
inline ll add(ll a, ll b) {
    return (mod + a + b) % mod;
}
inline ll sub(ll a, ll b) {
    return (a - b + mod) % mod;
}
inline ll mul(ll a, ll b) {
    return (1ll * a * b) % mod;
}

//POWER
ll fastpow(ll x, ll y) {
    ll res = 1; x = x % mod; while (y > 0) {
        if(y & 1)
            res = (res * x) % mod; 
        y = y >> 1;
        x = (x * x) % mod;
    }
    return res;
}

//MODULAR INVERSE
ll inv(ll x) {
    return fastpow(x, mod - 2);
}

//     ll n;
//     ll a[maxs];
//     ll tree[maxs];
bool vis[maxs];
vector < ll > graph[maxs];
//ALWAYS CLEAR THEM WHEN TESTCASES ARE GIVEN
//ALWAYS RETURN WHEN ST == ED CONDITION IN SEGMENT TREES

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s,t;
    cin >> s >> t;
    ll flg = 0;
    for(ll i = 0;i < s.size();++i)
    {
        if(s[i] != t[i])
        {
            flg = 1;
            break;
        }
    }
    
    if(flg)
        cout << "No";
    else
        cout << "Yes";
}

