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

solve s
  | (==[2, 2]) . map length . group . sort $ s = "Yes"
  | otherwise = "No"

main = solve <$> getLine >>= putStrLn