import Control.Applicative

isSubstr :: String -> String -> Bool
isSubstr _ [] = False
isSubstr s s'
    | m /= 0	   = isSubstr s (drop 1 s')
	| s'_repl == s = True
    | otherwise    = isSubstr s (drop 1 s')
    where m = length s `mod` length s'
    	  d = length s `div` length s'
          s'_repl = concat $ replicate d s'
          
main :: IO ()
main = do
	n <- getLine
	s <- getLine
	print $ if isSubstr s (drop 1 s) then "Yes" else "No"