import Control.Applicative
import Data.List

main :: IO ()
main = do
    s <- getLine
    putStrLn $ solve (sort s)

solve :: String -> String
solve s = if s !! 0 == s !! 1 && s !! 1 == s !! 2 then "Yes" else "No"