import Data.List

fiftyFifty :: String -> Bool
fiftyFifty (a:b:c:d:_)
    | a == b && c == d = True
    | a == c && b == d = True
    | a == d && b == c = True
    | otherwise = False

main = do
  s <- getLine
  putStrLn $ if fiftyFifty s then "Yes" else "No"
