fun main (args:Array<String>){
    val badid : String = (readLine()!!)
    val newid : String = (readLine()!!)
    val nidlen : Int = newid.length
    val aaa : String = newid.substring(0,nidlen-1)
    if(badid == aaa){
        print("Yes")
    }
    else{
        print("No")
    }
}
