{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nIn the middle of the XX-th century Roger Penrose impressed many mathematicians showing that there\nexists a set of tiles that can cover the whole plane, but only aperiodically. On the contrary, in this\nproblem we are interested in periodic tilings, more of that, in regular tilings.\nConsider a connected set of unit squares. It is called a polyomino. A polyomino is said to tile the plane\nin a regular way, if one can cover the whole plane with non-overlapping copies of the selected polyomino\nin such a way that:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u0026nbsp;\u0026nbsp;all copies can be transformed one to another using translation only, rotations and flips are not allowed; \n\u003c/li\u003e\u003cli\u003e\u0026nbsp;\u0026nbsp;each copy has the same surrounding polyominoes, that is, if we select some polyomino and translate\n the whole plane so that the top-left corner of the selected polyomino is in the coordinates center,\n the picture is the same for all polyominoes.\n\u003c/li\u003e\u003c/ol\u003e\n\u003cp\u003e\t \nGiven a polyomino, find out if it is possible to tile the plane with it in a regular way. You may find useful\nthe following fact: if it is possible to tile the plane with some polyomino in a regular way, then in the\ntiling each polyomino has a common border of non-zero length with at most six other polyominoes.\n\u003c/p\u003e\n\u003cp\u003e\n\u003cb\u003e\nInput\n\u003c/b\u003e\n\u003c/p\u003e\u003cp\u003e\nThere are severval test cases.The first line of each test case is a positive integen n(0\u0026lt;n\u0026lt;\u003d50).Then there\u0027re n lines of characters.\nThe n lines describes a part of the plane that contains the given polyomino, represented by the characters\n\u0027.\u0027(dot) denoting empty spaces and \u0027*\u0027(asterisk) denoting squares that belong to the polyomino. \neach line contains at most 50 characters.\nThe polyomino is constructed of at most 30 unit squares.\nThe input is terminaled by EOF.\n\u003c/p\u003e\n\u003cp\u003e\n\u003cb\u003e\nOutput\n\u003c/b\u003e\n\u003c/p\u003e\n\u003cp\u003e\nThere is only one line for each test case.\nOutput \"YES\" if it is possible to tile the plane in a regular way with the polyomino given, or \"NO\" if it is impossible.\n\u003c/p\u003e\n\n\u003cp\u003e\n\u003cb\u003e\nSample Input\n\u003c/b\u003e\n\u003c/p\u003e\n\u003cpre\u003e4\n....\n.*..\n.**.\n.....\n4\n....\n.*..\n.**.*\n..***\n5\n....\n.***.\n..*..\n.***.\n..*..\n\u003c/pre\u003e\n\n\u003cp\u003e\n\u003cb\u003e\nSample Output\n\u003c/b\u003e\n\u003c/p\u003e\n\u003cpre\u003eYES\nNO\nYES\n\u003c/pre\u003e\n\n\n\u003cbr\u003e\n"}}]}