isStripe :: Eq a => [a] -> Bool isStripe [] = True isStripe (a:[]) = True isStripe (a:b:[]) = a /= b isStripe (a:b:c:xs) | a == c && a /= b = isStripe (b:c:xs) | otherwise = False main = do getLine s <- getLine putStrLn $ if length s <= 3 && isStripe s then "NO" else "YES"