import std;
enum inf(T)()if(__traits(isArithmetic,T)){return T.max/4;}
T scan(T=long)(){return readln.chomp.to!T;}
void scan(T...)(ref T args){auto input=readln.chomp.split;foreach(i,t;T)args[i]=input[i].to!t;}
T[] scanarr(T=long)(){return readln.chomp.split.to!(T[]);}
//END OF TEMPLATE

void main(){
    auto s=scan!string;
    auto t=scan!string;
    foreach(i;0..s.length){
        if(s[i]!=t[i]){
            "No".writeln;
            return;
        }
    }   
    "Yes".writeln;
}
