{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u003cimg alt\u003d\"Map\" src\u003d\"http://www.spoj.pl/content/simba:p1.jpg\" style\u003d\"float: right; margin: 3px 8px;\" /\u003e Jedi knights, Qui-Gon Jinn and his young apprentice Obi-Wan Kenobi, are entrusted by Queen Padm\u0026eacute; Amidala to save \u003cb\u003eNaboo\u003c/b\u003e from an invasion by the Trade Federation. They must leave Naboo immediately and go to \u003cb\u003eTatooine\u003c/b\u003e to pick up the proof of the Federation\u0026rsquo;s evil design. They then must proceed on to the Republic\u0026rsquo;s capital planet \u003cb\u003eCoruscant\u003c/b\u003e to produce it in front of the Republic\u0026rsquo;s Senate. To help them in this endeavor, the queen\u0026rsquo;s captain provides them with an intergalactic map. This map shows connections between planets not yet blockaded by the Trade Federation. Any pair of planets has at most one connection between them, and all the connections are two-way. To avoid detection by enemy spies, the knights must embark on this adventure without visiting any planet more than once. Can you help them by determining if such a path exists?\u003cbr /\u003e\r\n\t\u003cbr /\u003e\r\n\t\u003cb\u003eNote\u003c/b\u003e - In the attached map, the desired path is shown in bold.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t注意:顶点编号可能不连续,甚至可能为负。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first line of the input is a positive integer t \u0026le; 20, which is the number of test cases. The descri_ptions of the test cases follow one after the other. The first line of each test case is a pair of positive integers n, m (separated by a single space). 2 \u0026le; n \u0026le; 30011 is the number of planets and m \u0026le; 50011 is the number of connections between planets. The planets are indexed with integers from 1 to n. The indices of Naboo, Tatooine and Coruscant are 1, 2, 3 respectively. The next m lines contain two integers each, giving pairs of planets that have a connection between them.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe output should contain t lines. The i\u003csup\u003eth\u003c/sup\u003e line corresponds to the i\u003csup\u003eth\u003c/sup\u003e test case. The output for each test case should be \u003cb\u003eYES\u003c/b\u003e if the required path exists and \u003cb\u003eNO\u003c/b\u003e otherwise.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t2\u003cbr /\u003e\r\n\t3 3\u003cbr /\u003e\r\n\t1 2\u003cbr /\u003e\r\n\t2 3\u003cbr /\u003e\r\n\t1 3\u003cbr /\u003e\r\n\t3 1\u003cbr /\u003e\r\n\t1 3\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tYES\u003cbr /\u003e\r\n\tNO\u003c/p\u003e"}}]}