open Batteries
let s = String.explode (read_line ())
let t = String.explode (read_line ())
let tail = List.hd (List.rev t)
let ans = List.fold_left2 (fun b x y -> if x = y then b else false) true (s @@ [tail]) s
let () = print_endline (if ans then "Yes" else "No")