object Main extends App {
  import java.util.Scanner
  val sc = new Scanner(System.in)

  val s = sc.nextLine()
  val t = sc.nextLine()
  val result = if (t.substring(0, s.length) == s) "Yes" else "No"
  println(result)
}
