import qualified Data.ByteString.Char8 as BS
import Data.List

getString = BS.unpack <$> BS.getLine

main = getString >>= \s -> putStrLn $ if all (== 2) (map length (group (sort s))) then "Yes" else "No"
