{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\nIn 1967, the famous American sociologist Stanley Milgram proposed a famous hypothesis called the \"small world phenomenon.\" The essence of this hypothesis is that there are at most only six degrees of separation between any two completely unfamiliar people, meaning that they can be connected through at most six intermediaries. Therefore, his theory is also known as the \"six degrees of separation\" theory. Although Milgram\u0027s theory has been repeatedly confirmed and has attracted the interest of many sociologists, it has never been rigorously proven in over 30 years. It remains a legendary hypothesis. \n \u003cbr\u003e\n \u003cbr\u003e\n Lele is quite interested in this theory, so he conducted a survey on N individuals in HDU. He has obtained information about their acquaintances and now asks for your help to verify whether the \"six degrees of separation\" holds true.\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"This problem contains multiple test cases, please process until the end of file.\n\u003cbr\u003e\nFor each test case, the first line contains two integers N and M (0\u003cN\u003c100, 0\u003cM\u003c200), representing the number of people in HDU (numbered from 0 to N-1) and the relationships between them.\n\u003cbr\u003e\nThe following M lines each contain two integers A and B (0\u003c\u003dA,B\u003cN) representing that the individuals with the numbers A and B in HDU know each other.\n\u003cbr\u003e\nApart from these M relationships, any other two people do not know each other.\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output \"Yes\" in a single line if the data conforms to the \"six degrees of separation\" theory, otherwise output \"No\"."}},{"title":"Sample","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\u003e8 7\r\n0 1\r\n1 2\r\n2 3\r\n3 4\r\n4 5\r\n5 6\r\n6 7\r\n8 8\r\n0 1\r\n1 2\r\n2 3\r\n3 4\r\n4 5\r\n5 6\r\n6 7\r\n7 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\nYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}