{"trustable":false,"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\u003eDany Vera has $$$26$$$ tasks. Each task is designated by a capital letter of the Latin alphabet.\u003c/p\u003e\n\u003cp\u003eThe teacher asked Dany to solve tasks in the following way: if Dany began to solve some task, then she must solve it to the end, without being distracted by another task. After switching to another task, Dany cannot return to the previous task.\u003c/p\u003e\n\u003cp\u003eDany can only solve one task during the day. Every day she wrote down what task she solved. Now the teacher wants to know if Dany followed his advice.\u003c/p\u003e\n\u003cp\u003eFor example, if Dany 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 Dany began to solve the task \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eB\u003c/span\u003e\u0027, then on the fifth day she 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 Dany 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\n\u003cp\u003eIf Dany 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 Dany 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\n\u003cp\u003eHelp Dany 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\n\u003cp\u003eThe first line of each test case contains one integer $$$n$$$ ($$$1 \\le n \\le 50$$$)\u0026nbsp;— the number of days during which Dany solved tasks.\u003c/p\u003e\n\u003cp\u003eThe second line contains a string of length $$$n$$$, consisting of uppercase Latin letters, which is the order in which Dany solved the tasks.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case output: \u003c/p\u003e\n\u003cul\u003e \n \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\n \u003cli\u003e \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\", otherwise. \u003c/li\u003e\n\u003c/ul\u003e\n\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":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\n3\nABA\n11\nDDBBCCCBBEZ\n7\nFFGZZZY\n1\nZ\n2\nAB\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eNO\nNO\nYES\nYES\nYES\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}