open System

[<EntryPoint>]
let main argv =
    let s = Console.ReadLine().ToCharArray()
    (if s 
        |> Array.groupBy (fun x -> x) 
        |> Array.forall (fun (key, elems) -> elems |> Array.length = 2) then 
        "Yes" 
    else 
        "No") |> Console.WriteLine
    0