{"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如今,我国每年至少举办一场摔跤比赛。在比赛中有很多人被认为是“好选手”,其余的则是“坏选手”。现在,小明是摔跤比赛的裁判,他手里有一份比赛列表。与此同时,他知道一些人是好选手,一些人是坏选手。他相信每场比赛都是好选手和坏选手之间的较量。现在他想知道是否所有人都可以被划分为“好选手”和“坏选手”。\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e输入包含多组数据。对于每组数据,第一行有四个数字:N(1 ≤ N ≤ 1000)、M(1 ≤ M ≤ 10000)、X,Y(X+Y ≤ N),分别表示选手数量(编号从1到N)、比赛数量、已知的“好选手”数量和已知的“坏选手”数量。接下来的M行中,每行有两个数字a, b(a ≠ b),表示选手a和选手b之间有一场比赛。接下来一行有X个不同的数字,每个数字代表一个已知的“好选手”编号。最后一行包含Y个不同的数字,每个数字代表一个已知的“坏选手”编号。数据保证不存在一个选手既是好选手又是坏选手。\u003c/div\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e如果所有人都可以被划分为“好选手”和“坏选手”,则输出“YES”,否则输出“NO”。\u003c/div\u003e"}},{"title":"样例","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\u003e5 4 0 0\r\n1 3\r\n1 4\r\n3 5\r\n4 5\r\n5 4 1 0\r\n1 3\r\n1 4\r\n3 5\r\n4 5\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\r\nYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}