{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eStudent Andrey has been skipping physical education lessons for the whole term, and now he must somehow get a passing grade on this subject. Obviously, it is impossible to do this by legal means, but Andrey doesn\u0027t give up. Having obtained an empty certificate from a local hospital, he is going to use his knowledge of local doctor\u0027s handwriting to make a counterfeit certificate of illness. However, after writing most of the certificate, Andrey suddenly discovered that doctor\u0027s signature is impossible to forge. Or is it?\u003c/p\u003e\u003cp\u003eFor simplicity, the signature is represented as an $$$n\\times m$$$ grid, where every cell is either filled with ink or empty. Andrey\u0027s pen can fill a $$$3\\times3$$$ square without its central cell if it is completely contained inside the grid, as shown below.\u003c/p\u003e\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003exxx\u003cbr\u003ex.x\u003cbr\u003exxx\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e\u003cp\u003eDetermine whether is it possible to forge the signature on an empty $$$n\\times m$$$ grid.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of input contains two integers $$$n$$$ and $$$m$$$ ($$$3 \\le n, m \\le 1000$$$).\u003c/p\u003e\u003cp\u003eThen $$$n$$$ lines follow, each contains $$$m$$$ characters. Each of the characters is either \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e.\u003c/span\u003e\u0027, representing an empty cell, or \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003e#\u003c/span\u003e\u0027, representing an ink filled cell.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf Andrey can forge the signature, output \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\". Otherwise output \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eYou can print each letter in any case (upper or lower).\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\u003e3 3\n###\n#.#\n###\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"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\u003e3 3\n###\n###\n###\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"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\u003e4 3\n###\n###\n###\n###\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"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 7\n.......\n.#####.\n.#.#.#.\n.#####.\n.......\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first sample Andrey can paint the border of the square with the center in $$$(2, 2)$$$.\u003c/p\u003e\u003cp\u003eIn the second sample the signature is impossible to forge.\u003c/p\u003e\u003cp\u003eIn the third sample Andrey can paint the borders of the squares with the centers in $$$(2, 2)$$$ and $$$(3, 2)$$$: \u003c/p\u003e\u003col\u003e \u003cli\u003e we have a clear paper:\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003e...\u003cbr\u003e...\u003cbr\u003e...\u003cbr\u003e...\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e\u003c/li\u003e\u003cli\u003e use the pen with center at $$$(2, 2)$$$.\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003e###\u003cbr\u003e#.#\u003cbr\u003e###\u003cbr\u003e...\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e\u003c/li\u003e\u003cli\u003e use the pen with center at $$$(3, 2)$$$.\u003ccenter\u003e \u003cpre class\u003d\"verbatim\"\u003e\u003cbr\u003e###\u003cbr\u003e###\u003cbr\u003e###\u003cbr\u003e###\u003cbr\u003e\u003c/pre\u003e \u003c/center\u003e\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eIn the fourth sample Andrey can paint the borders of the squares with the centers in $$$(3, 3)$$$ and $$$(3, 5)$$$.\u003c/p\u003e"}}]}