[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

let rec f x = function
    | [] -> true
    | y :: ys -> if x = y then false else f y ys

[<EntryPoint>]
let main argv =
    let s = read string
    s.ToCharArray()
    |> Array.sort
    |> fun [|a;b;c;d|] -> if a = b && c = d then "Yes" else "No"
    |> printfn "%s"
    0