
lingTry ss [] = True
lingTry (s:ss) (p:ps) = if s == p then lingTry ss ps else False

lingSearch (s:ss) ps cnt = if flag 
  then if res
    then cnt
    else lingSearch (ss ++ [s]) ps (cnt + 1) 
  else -1
  where
    flag = cnt <= (length (s:ss)) + (length ps)
    res = lingTry (s:ss) ps

main = do
  s <- getLine
  p <- getLine
  putStrLn $ if lingSearch s p 0 /= -1 then "Yes" else "No"