open System 

let R() = Console.ReadLine()

let f (s: string): bool =
    s.ToCharArray()
    |> Array.groupBy id 
    |> Array.forall (fun (_,v) -> Array.length v = 2)

let S = R()

f S
|> function 
| true -> "Yes"
| _ -> "No"
|> printfn "%s"