{-# OPTIONS_GHC -O2 #-}
import Control.Applicative
import Data.List
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BS
import Data.Maybe (fromJust)

f :: [Char] -> String
f (a:b:c:d:_)
    | a == b && c == d && a /= c = "Yes"
    | otherwise = "No"

main :: IO()
main = interact $ f . sort