{"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\u003eYou are given a string $$$s$$$ consisting of $$$n$$$ lowercase Latin letters.\u003c/p\u003e\u003cp\u003eLet\u0027s define a substring as a contiguous subsegment of a string. For example, \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eacab\u003c/span\u003e\" is a substring of \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabacaba\u003c/span\u003e\" (it starts in position $$$3$$$ and ends in position $$$6$$$), but \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaa\u003c/span\u003e\" or \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ed\u003c/span\u003e\" aren\u0027t substrings of this string. So the substring of the string $$$s$$$ from position $$$l$$$ to position $$$r$$$ is $$$s[l; r] \u003d s_l s_{l + 1} \\dots s_r$$$.\u003c/p\u003e\u003cp\u003eYou have to choose \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly\u003c/span\u003e one of the substrings of the given string and reverse it (i. e. make $$$s[l; r] \u003d s_r s_{r - 1} \\dots s_l$$$) to obtain a string that is \u003cspan class\u003d\"tex-font-style-bf\"\u003eless\u003c/span\u003e lexicographically. Note that it \u003cspan class\u003d\"tex-font-style-bf\"\u003eis not necessary\u003c/span\u003e to obtain the minimum possible string.\u003c/p\u003e\u003cp\u003eIf it is impossible to reverse some substring of the given string to obtain a string that is less, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\". Otherwise print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" and \u003cspan class\u003d\"tex-font-style-bf\"\u003eany\u003c/span\u003e suitable substring.\u003c/p\u003e\u003cp\u003eString $$$x$$$ is lexicographically less than string $$$y$$$, if either $$$x$$$ is a prefix of $$$y$$$ (and $$$x \\ne y$$$), or there exists such $$$i$$$ ($$$1 \\le i \\le min(|x|, |y|)$$$), that $$$x_i \u0026lt; y_i$$$, and for any $$$j$$$ ($$$1 \\le j \u0026lt; i$$$) $$$x_j \u003d y_j$$$. Here $$$|a|$$$ denotes the length of the string $$$a$$$. The lexicographic comparison of strings is implemented by operator \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026lt;\u003c/span\u003e in modern programming languages.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one integer $$$n$$$ ($$$2 \\le n \\le 3 \\cdot 10^5$$$) — the length of $$$s$$$.\u003c/p\u003e\u003cp\u003eThe second line of the input contains the string $$$s$$$ of length $$$n$$$ consisting only of lowercase Latin letters.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is impossible to reverse some substring of the given string to obtain a string which is lexicographically \u003cspan class\u003d\"tex-font-style-bf\"\u003eless\u003c/span\u003e, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\". Otherwise print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" and two indices $$$l$$$ and $$$r$$$ ($$$1 \\le l \u0026lt; r \\le n$$$) denoting the substring you have to reverse. If there are multiple answers, you can print any.\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\u003e7\nabacaba\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n2 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\naabcfg\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first testcase the resulting string is \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eaacabba\u003c/span\u003e\".\u003c/p\u003e"}}]}