defmodule Main do

  def main do
    s = IO.gets("") #contains \n
    s = String.slice(s, 0, String.length(s)-1)
    t = IO.gets("")
    
    if String.slice(t, 0, String.length(t)-1) == s do
      IO.puts("Yes")
    else
      IO.puts("No")
    end
  end
end

Main.main
