import Control.Applicative
import Control.Monad
import Data.List

main = do
  s <- sort <$> getLine
  if (s !! 0 == s !! 1) && (s !! 1 /= s !! 2) && (s !! 2 == s !! 3)
    then putStrLn "Yes"
    else putStrLn "No"
