import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()
  val t = sc.next()

  println(abc167a(s, t))
}

private fun abc167a(s: String, t: String): String {
  val sub = t.substring(0, s.length)

  if (sub.equals(s)) return "Yes"
  return "No"
}
