{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\u003cb\u003eIt is preferrable to read the pdf statment.\u003c/b\u003e\u003cbr\u003e\u003cbr\u003eTwo strings are called \u003cb\u003ecyclical isomorphic\u003c/b\u003e if one can rotate one string to get another one. \u0027Rotate\u0027 here means \u0027\u0027to take some consecutive chars (maybe none) from the beginning of a string and put them back at the end of the string in the same order\u0027\u0027. For example, string \u0027\u0027abcde\u0027\u0027 can be rotated to string \u0027\u0027deabc\u0027\u0027.\u003cbr\u003e\u003cbr\u003eNow that you know what \u003cb\u003ecyclical isomorphic\u003c/b\u003e is, Cuber QQ wants to give you a little test.\u003cbr\u003e\u003cbr\u003eHere is a string $s$ of length $n$. Please check if $s$ is a concatenation of $k$ strings, $s_1,s_2,\\cdots,s_k$ ($k\u0026gt;1$), where,\u003cbr\u003e\u003cul\u003e\u003cbr\u003e \u003cli\u003e $k$ is a divisor of $n$;\u003c/li\u003e\u003cbr\u003e \u003cli\u003e $s_1,s_2,\\ldots,s_k$ are of equal length: $\\frac{n}{k}$;\u003c/li\u003e\u003cbr\u003e \u003cli\u003e There exists a string $t$, which is \u003cb\u003ecyclical isomorphic\u003c/b\u003e with $s_i$ for all $1\\le i\\le k$.\u003c/li\u003e\u003cbr\u003e\u003c/ul\u003e\u003cbr\u003ePrint \u0027\u0027Yes\u0027\u0027 if the check is positive, or \u0027\u0027No\u0027\u0027 otherwise.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer $T$ ($1\\le T\\le 1000$), denoting the number of test cases. $T$ cases follow.\u003cbr\u003e\u003cul\u003e\u003cbr\u003e\u003cli\u003e The first line of each test case contains an integer $n$ ($1\\le n \\le 5 \\cdot 10^6$).\u003c/li\u003e\u003cbr\u003e\u003cli\u003e The second line contains a string $s$ of length $n$ consists of lowercase letters only.\u003c/li\u003e\u003cbr\u003e\u003c/ul\u003e\u003cbr\u003eIt is guaranteed that the sum of $n$ does not exceed $2\\cdot 10^7$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line containing \u0027\u0027Yes\u0027\u0027 or \u0027\u0027No\u0027\u0027 (without quotes)."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n1\r\na\r\n2\r\naa\r\n3\r\naab\r\n4\r\nabba\r\n6\r\nabcbcc\r\n8\r\naaaaaaaa\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\r\nYes\r\nNo\r\nYes\r\nNo\r\nYes\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}