import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (sort, group)

main :: IO ()
main = do
  s <- getLine :: IO String
  putStrLn $ if ((&&) <$> (== 2) . length <*> all (== 2)) . map length . group . sort $ s then "Yes" else "No"
  
  print (n - k + 1)

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
