let () =
  print_endline @@
  Scanf.scanf "%s" @@ fun s ->
  let s = Array.init (String.length s) (fun i -> s.[i]) in
  Array.sort compare s;
  if s.(0) = s.(1) && s.(1) <> s.(2) && s.(2) = s.(3) then "Yes" else "No"
