{-# LANGUAGE ScopedTypeVariables, LambdaCase #-}

import qualified Data.List as List
import qualified Data.Set as Set

main :: IO ()
main = do
    [a, b, c, d]<- getLine
    if a  == b && a == c  || b == c && b == d then putStrLn "Yes" else  putStrLn "No"