import           Control.Applicative()
import           Data.List

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

