fun main(args: Array<String>){
    // 使用済
    val s = next()
    // next(s+n)
    val t = next()

    val res = if(s == t.substring(0,s.length)) "Yes" else "No"
    println(res)
    
}
fun next() = readLine()!!
