{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N$ consisting of lowercase English letters. Determine whether it is possible to divide $S$ into two or more consecutive substrings so that they are strictly increasing in lexicographical order.\nTo be precise, determine whether there is a sequence of strings $t=(t_1,t_2,\\dots,t_k)$ that satisfies all of the following conditions.\n\n*   The length of the sequence $k$ is at least $2$.\n    \n*   $t_i$ is not empty. ($1 \\le i \\le k$)\n    \n*   Concatenating $t_1,t_2,\\dots,t_k$ in this order results in $S$.\n    \n*   $t_i$ is lexicographically smaller than $t_{i+1}$ for every integer $i$ such that $1 \\le i < k$.\n    \n\nYou are given $T$ test cases. Find the answer for each of them.\nWhat is lexicographical order?A string $S = S_1S_2\\ldots S_{|S|}$ is said to be **lexicographically smaller** than a string $T = T_1T_2\\ldots T_{|T|}$ if either 1. or 2. below holds. Here, $|S|$ and $|T|$ represent the lengths of $S$ and $T$, respectively.\n\n1.  $|S| \\lt |T|$ and $S_1S_2\\ldots S_{|S|} = T_1T_2\\ldots T_{|S|}$.\n2.  There is an integer $1 \\leq i \\leq \\min\\lbrace |S|, |T| \\rbrace$ such that both of the following hold.\n    *   $S_1S_2\\ldots S_{i-1} = T_1T_2\\ldots T_{i-1}$.\n    *   The character $S_i$ comes before $T_i$ in alphabetical order."},{"iden":"constraints","content":"*   $1 \\le T \\le 2000$\n*   $2 \\le N \\le 2000$\n*   $S$ is a string of length $N$ consisting of lowercase English letters.\n*   The sum of $N$ over all test cases in a single input does not exceed $2000$."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nHere, $\\mathrm{case}_i$ represents the $i$\\-th test case. Each test case is given in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"5\n4\nabac\n3\ncac\n2\nab\n12\nabababababab\n5\nedcba"},{"iden":"sample output 1","content":"Yes\nNo\nYes\nYes\nNo\n\nFor the first test case, you can divide $S$ into `a`, `ba`, `c`.\nFor the second test case, there is no way to divide $S$ into substrings so that they are strictly increasing in lexicographical order."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}