import Data.Maybe
import Data.List

main = do
  s <- getLine
  let t = s ++ "NEWS"
  putStrLn $ (\a -> if (head a == 1 && last a > 1) || (head a > 1 && last a == 1) || (a!!1 == 1 && a!!2 > 1) || (a!!1 > 1 && a!!2 == 1) then "No" else "Yes") $ map length $ group $ sort t

