let fifty s =
  if s.[0] = s.[1] then if s.[2] = s.[3] then "Yes"
                                         else "No"
  else if s.[0] = s.[2] then if s.[1] = s.[3] then "Yes"
                                              else "No"
  else if s.[0] = s.[3] then if s.[1] = s.[2] then "Yes"
                                              else "No"
  else "No"

let () = Printf.printf "%s\n" (fifty (read_line ()))