{"trustable":false,"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":"\u003ca href\u003d\"https://codeforces.com/problemset/problem/1324/A\"\u003eProblem Link\u003c/a\u003e"}},{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given some Tetris field consisting of $$$n$$$ columns. The initial height of the $$$i$$$-th column of the field is $$$a_i$$$ blocks. On top of these columns you can place \u003cspan class\u003d\"tex-font-style-bf\"\u003eonly\u003c/span\u003e figures of size $$$2 \\times 1$$$ (i.e. the height of this figure is $$$2$$$ blocks and the width of this figure is $$$1$$$ block). Note that you \u003cspan class\u003d\"tex-font-style-bf\"\u003ecannot\u003c/span\u003e rotate these figures.\u003c/p\u003e\u003cp\u003eYour task is to say if you can clear the whole field by placing such figures.\u003c/p\u003e\u003cp\u003eMore formally, the problem can be described like this:\u003c/p\u003e\u003cp\u003eThe following process occurs while \u003cspan class\u003d\"tex-font-style-bf\"\u003eat least one $$$a_i$$$ is greater than $$$0$$$\u003c/span\u003e:\u003c/p\u003e\u003col\u003e \u003cli\u003e You place one figure $$$2 \\times 1$$$ (choose some $$$i$$$ from $$$1$$$ to $$$n$$$ and replace $$$a_i$$$ with $$$a_i + 2$$$); \u003c/li\u003e\u003cli\u003e then, while all $$$a_i$$$ are greater than zero, replace each $$$a_i$$$ with $$$a_i - 1$$$. \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eAnd your task is to determine if it is possible to clear the whole field (i.e. finish the described process), choosing the places for new figures properly.\u003c/p\u003e\u003cp\u003eYou have to answer $$$t$$$ independent test cases.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one integer $$$t$$$ ($$$1 \\le t \\le 100$$$) — the number of test cases.\u003c/p\u003e\u003cp\u003eThe next $$$2t$$$ lines describe test cases. The first line of the test case contains one integer $$$n$$$ ($$$1 \\le n \\le 100$$$) — the number of columns in the Tetris field. The second line of the test case contains $$$n$$$ integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 100$$$), where $$$a_i$$$ is the initial height of the $$$i$$$-th column of the Tetris field.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print the answer — \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" (without quotes) if you can clear the whole Tetris field and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\" otherwise.\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\u003e4\n3\n1 1 3\n4\n1 1 2 1\n2\n11 11\n1\n100\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\nYES\nYES\n\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\u003eThe first test case of the example field is shown below:\u003c/p\u003e\u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/abf06928fcafb0e6cf3acab2fc7466bd?v\u003d1718827912\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e\u003cp\u003eGray lines are bounds of the Tetris field. Note that the field has no upper bound.\u003c/p\u003e\u003cp\u003eOne of the correct answers is to first place the figure in the first column. Then after the second step of the process, the field becomes $$$[2, 0, 2]$$$. Then place the figure in the second column and after the second step of the process, the field becomes $$$[0, 0, 0]$$$.\u003c/p\u003e\u003cp\u003eAnd the second test case of the example field is shown below:\u003c/p\u003e\u003cp\u003e\u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/e32dad48c44731e4dd5f779287164f89?v\u003d1718827912\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e\u003cp\u003eIt can be shown that you cannot do anything to end the process.\u003c/p\u003e\u003cp\u003eIn the third test case of the example, you first place the figure in the second column after the second step of the process, the field becomes $$$[0, 2]$$$. Then place the figure in the first column and after the second step of the process, the field becomes $$$[0, 0]$$$.\u003c/p\u003e\u003cp\u003eIn the fourth test case of the example, place the figure in the first column, then the field becomes $$$[102]$$$ after the first step of the process, and then the field becomes $$$[0]$$$ after the second step of the process.\u003c/p\u003e"}}]}