{"trustable":false,"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\r\n\t\u003cspan data-scayt_word\u003d\"为了路痴的方向感,路痴走进了一座大城堡,里面有N个房间\" data-scaytid\u003d\"1\"\u003e为了路痴的方向感,路痴走进了一座大城堡,里面有N个房间\u003c/span\u003e(N\u0026lt;\u003d10000)\u003cspan data-scayt_word\u003d\"和M条道路\" data-scaytid\u003d\"2\"\u003e和M条道路\u003c/span\u003e(M\u0026lt;\u003d100000)\u003cspan data-scayt_word\u003d\",每个道路都是单向的,就是说若称某道路连通了A房间和B房间,只说明可以通过这个道路由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。现在需要请你写个程序确认一下是否任意两个房间都是相互连通的。\" data-scaytid\u003d\"3\"\u003e,每个道路都是单向的,就是说若称某道路连通了A房间和B房间,只说明可以通过这个道路由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。现在需要请你写个程序确认一下是否任意两个房间都是相互连通的。\u003c/span\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cspan data-scayt_word\u003d\"输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。\" data-scaytid\u003d\"4\"\u003e输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。\u003c/span\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cspan data-scayt_word\u003d\"对于输入的每组数据,如果任意两个房间都是相互连接的,输出\" data-scaytid\u003d\"5\"\u003e对于输入的每组数据,如果任意两个房间都是相互连接的,输出\u003c/span\u003e\u0026quot;Yes\u0026quot;\u003cspan data-scayt_word\u003d\",否则输出\" data-scaytid\u003d\"6\"\u003e,否则输出\u003c/span\u003e\u0026quot;No\u0026quot;。\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cpre\u003e\r\n\t\u003c/pre\u003e\r\n\t\u003cdiv style\u003d\"font-family:Courier New,Courier,monospace;\"\u003e\r\n\t\t\u003cpre\u003e\r\n\t\t3 3\r\n1 2\r\n2 3\r\n3 1\r\n3 3\r\n1 2\r\n2 3\r\n3 2\r\n0 0\u003c/pre\u003e\r\n\t\u003c/div\u003e\r\n\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cpre\u003e\r\n\t\u003c/pre\u003e\r\n\t\u003cdiv style\u003d\"font-family:Courier New,Courier,monospace;\"\u003e\r\n\t\t\u003cpre\u003e\r\n\t\tYes\r\nNo\u003c/pre\u003e\r\n\t\u003c/div\u003e\r\n\u003c/div\u003e"}}]}