{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003ePolycarp has $$$26$$$ tasks. Each task is designated by a capital letter of the Latin alphabet.\u003c/p\u003e\u003cp\u003eThe teacher asked Polycarp to solve tasks in the following way: if Polycarp began to solve some task, then he must solve it to the end, without being distracted by another task. After switching to another task, Polycarp cannot return to the previous task.\u003c/p\u003e\u003cp\u003ePolycarp can only solve one task during the day. Every day he wrote down what task he solved. Now the teacher wants to know if Polycarp followed his advice.\u003c/p\u003e\u003cp\u003eFor example, if Polycarp solved tasks in the following order: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDDBBCCCBBEZ\u003c/span\u003e\", then the teacher will see that on the third day Polycarp began to solve the task \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eB\u003c/span\u003e\u0027, then on the fifth day he got distracted and began to solve the task \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e\u0027, on the eighth day Polycarp returned to the task \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eB\u003c/span\u003e\u0027. Other examples of when the teacher is suspicious: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eBAB\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eAABBCCDDEEBZZ\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eAAAAZAAAAA\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eIf Polycarp solved the tasks as follows: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eFFGZZZY\u003c/span\u003e\", then the teacher cannot have any suspicions. Please note that Polycarp is not obligated to solve all tasks. Other examples of when the teacher doesn\u0027t have any suspicious: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eBA\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eAFFFCC\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYYYYY\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eHelp Polycarp find out if his teacher might be suspicious.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains an integer $$$t$$$ ($$$1 \\le t \\le 1000$$$). Then $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains one integer $$$n$$$ ($$$1 \\le n \\le 50$$$)\u0026nbsp;— the number of days during which Polycarp solved tasks.\u003c/p\u003e\u003cp\u003eThe second line contains a string of length $$$n$$$, consisting of uppercase Latin letters, which is the order in which Polycarp solved the tasks.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case output: \u003c/p\u003e\u003cul\u003e \u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\", if the teacher \u003cspan class\u003d\"tex-font-style-bf\"\u003ecannot be suspicious\u003c/span\u003e; \u003c/li\u003e\u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\", otherwise. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou may print every letter in any case you want (so, for example, the strings \u003cspan class\u003d\"tex-font-style-tt\"\u003eyEs\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eyes\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e are all recognized as positive answer).\u003c/p\u003e"}},{"title":"Examples","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\u003e5\n3\nABA\n11\nDDBBCCCBBEZ\n7\nFFGZZZY\n1\nZ\n2\nAB\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\nNO\nYES\nYES\nYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}