{"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\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eEssa wanted to meet the most powerful number theorist of all time: Bahosain, but Bahosain does not waste his precious time, so he gave Essa this puzzle in order to test his abilities.\u003c/p\u003e\u003cp\u003eGiven two arrays, the second array only has distinct elements, Essa can do the following as many times as he wants to make all numbers in first array equal.\u003c/p\u003e\u003col\u003e \u003cli\u003e Choose a number from the first array \u003c/li\u003e\u003cli\u003e Add or subtract from it a number in the second array \u003c/li\u003e\u003cli\u003e Replace the number in the first array with the result \u003c/li\u003e\u003c/ol\u003e Of course, Essa is unworthy of meeting the almighty Bahosain, and he can\u0027t solve this puzzle on his own, so can you help him?"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line containing two space separated integers $$$n,m$$$ ($$$1\\le n,k \\le 10^6$$$) represent the length of the first and second array.\u003c/p\u003e\u003cp\u003ethe second line contains n integers represent the first array ($$$1\\le a[i] \\le 10^9$$$)\u003c/p\u003e\u003cp\u003ethe third line contains m integers represent the second array ($$$1\\le b[i] \\le 10^9$$$)\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint Yes, if it\u0027s possible to make all numbers in first array equal; and No in the opposite case.\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\u003e5 2\n3 6 7 2 5\n2 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}