{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eWould you want to fight against bears riding horses? Me neither.\u003c/p\u003e\u003cp\u003eLimak is a grizzly bear. He is a general of the dreadful army of Bearland. The most important part of an army is the cavalry of course.\u003c/p\u003e\u003cp\u003eThe cavalry of Bearland consists of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e warriors and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e horses, both numbered \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e through \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e. Limak knows the strength of each warrior \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e and of each horse \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eA warrior together with his horse is called a unit. The strength of a unit is equal to the multiplied strengths of a warrior and a horse.\u003c/p\u003e\u003cp\u003eGeneral Limak must assign all horses to warriors, one horse per warrior. The cavalry will consist of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e units then.\u003c/p\u003e\u003cp\u003eThe first warrior (the one with the strength \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e\u003c/span\u003e) is called Bravebeart. He is always the first to charge the enemy. Limak decided that Bravebeart deserves some respect and his unit must be the strongest one, with no ties allowed. But is it possible?\u003c/p\u003e\u003cp\u003eHelp Limak and check whether there is an assignment of horses to warriors for which the Bravebeart\u0027s unit is strictly stronger than any other unit. Print \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"YES\"\u003c/span\u003e or \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"NO\"\u003c/span\u003e (without the quotes).\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eYou are given multiple test cases.\u003c/p\u003e\u003cp\u003eThe first line of the input contains one integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eT\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eT\u003c/i\u003e ≤ 50\u003c/span\u003e), denoting the number of test cases.\u003c/p\u003e\u003cp\u003eFor each test case the first line contains one integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e2 ≤ \u003ci\u003en\u003c/i\u003e ≤ 42\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eThe second line contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003ew\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 1000\u003c/span\u003e), denoting strengths of warriors. The first number is the strength of Bravebeart.\u003c/p\u003e\u003cp\u003eThe third line contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003eh\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 1000\u003c/span\u003e), denoting strengths of horses.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case find the answer and print it in a separate line.\u003c/p\u003e\u003cp\u003ePrint \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"YES\"\u003c/span\u003e (without the quotes) if there is an assignment where the strength of the Bravebeart\u0027s unit is strictly greater than strength of any other unit. Otherwise print \u003cspan class\u003d\"tex-font-style-tt\"\u003e\"NO\"\u003c/span\u003e (without the quotes).\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\u003e2\n6\n12 9 7 1 20 10\n3 6 4 7 5 5\n4\n5 17 10 1\n200 400 800 600\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\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 test case Bravebeart can take a horse of strength \u003cspan class\u003d\"tex-span\"\u003e6\u003c/span\u003e to get the unit strength \u003cspan class\u003d\"tex-span\"\u003e12·6 \u003d 72\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIn one way of assigning other horses to warriors the pairs (strength of warrior, strength of horse) are: \u003cspan class\u003d\"tex-span\"\u003e(9, 7)\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e(7, 5)\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e(1, 5)\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e(20, 3)\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e(10, 4)\u003c/span\u003e. Units strengths would be \u003cspan class\u003d\"tex-span\"\u003e63\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e35\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e60\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e40\u003c/span\u003e, respectively. Indeed, the Bravebeart\u0027s unit is stronger than any other unit then.\u003c/p\u003e\u003cp\u003eIn the second test case it\u0027s impossible to assign horses to warriors so that Bravebeart\u0027s unit is stronger than any other one.\u003c/p\u003e"}}]}