defmodule Main do
  def solve(s, t, c) do
  	[head | tail] = s
    if s == t do
      true
    else
      solve(tail ++ [head], t, c - 1)
      end
  end
  
  def solve(s, t, 0) do
    false
  end
  def main do
    s =
      IO.read(:line)
      |> String.trim |> String.to_charlist
    t =
      IO.read(:line)
      |> String.trim |> String.to_charlist
     if solve(s, t, length(s)) do
       IO.puts("Yes")
     else
       IO.puts("No")
       end
  end
end
