import Data.Bool import Data.List main = do n <- readLn s <- getLine putStrLn (bool "NO" "YES" (n>3 || length (group s) < n))