let f s =  (* string -> char list *)
  let as_ = Array.make (String.length s) 'c' in 
  String.iteri (fun i x -> as_.(i) <- x) s;
  Array.to_list as_ ;;

let rec hd_eq a1 a2 = match (a1, a2) with
    ([], _) -> true
  | (_, []) -> false
  | (x :: xs, y :: ys) when x = y -> hd_eq xs ys
  | (x :: xs, y :: ys) -> false ;;

let rec inc a1 a2 =
  if a2 = [] then false
  else if hd_eq a1 a2 then true
  else (match a2 with
          [] -> false
        | x :: xs -> inc a1 xs) ;;

let () =
  let s1 = let s = read_line() in s ^ s in
  let s2 = read_line() in
  let list = f s1 in
  let word = f s2 in
  if inc word list then print_endline "Yes"
  else print_endline "No" ;;
