{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eWe have an \u003cvar\u003e\\(H\\)\u003c/var\u003e-by-\u003cvar\u003e\\(W\\)\u003c/var\u003e matrix.\r\nLet \u003cvar\u003e\\(a_{ij}\\)\u003c/var\u003e be the element at the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th row from the top and \u003cvar\u003e\\(j\\)\u003c/var\u003e-th column from the left.\r\nIn this matrix, each \u003cvar\u003e\\(a_{ij}\\)\u003c/var\u003e is a lowercase English letter.\u003c/p\u003e\r\n\u003cp\u003eSnuke is creating another \u003cvar\u003e\\(H\\)\u003c/var\u003e-by-\u003cvar\u003e\\(W\\)\u003c/var\u003e matrix, \u003cvar\u003e\\(A\u0027\\)\u003c/var\u003e, by freely rearranging the elements in \u003cvar\u003e\\(A\\)\u003c/var\u003e.\r\nHere, he wants to satisfy the following condition:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eEvery row and column in \u003cvar\u003e\\(A\u0027\\)\u003c/var\u003e can be read as a palindrome.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eDetermine whether he can create a matrix satisfying the condition.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Note","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eA \u003cem\u003epalindrome\u003c/em\u003e is a string that reads the same forward and backward.\r\nFor example, \u003ccode\u003ea\u003c/code\u003e, \u003ccode\u003eaa\u003c/code\u003e, \u003ccode\u003eabba\u003c/code\u003e and \u003ccode\u003eabcba\u003c/code\u003e are all palindromes, while \u003ccode\u003eab\u003c/code\u003e, \u003ccode\u003eabab\u003c/code\u003e and \u003ccode\u003eabcda\u003c/code\u003e are not.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 ≤ H, W ≤ 100\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(a_{ij}\\)\u003c/var\u003e is a lowercase English letter.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(H\\)\u003c/var\u003e \u003cvar\u003e\\(W\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_{11}\\)\u003c/var\u003e\u003cvar\u003e\\(a_{12}\\)\u003c/var\u003e\u003cvar\u003e\\(...\\)\u003c/var\u003e\u003cvar\u003e\\(a_{1W}\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_{H1}\\)\u003c/var\u003e\u003cvar\u003e\\(a_{H2}\\)\u003c/var\u003e\u003cvar\u003e\\(...\\)\u003c/var\u003e\u003cvar\u003e\\(a_{HW}\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eIf Snuke can create a matrix satisfying the condition, print \u003ccode\u003eYes\u003c/code\u003e; otherwise, print \u003ccode\u003eNo\u003c/code\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","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 4\r\naabb\r\naabb\r\naacc\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eFor example, the following matrix satisfies the condition.\u003c/p\u003e\r\n\u003cpre\u003eabba\r\nacca\r\nabba\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","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\u003e2 2\r\naa\r\nbb\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eIt is not possible to create a matrix satisfying the condition, no matter how we rearrange the elements in \u003cvar\u003e\\(A\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 3","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 1\r\nt\r\nw\r\ne\r\ne\r\nt\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eFor example, the following matrix satisfies the condition.\u003c/p\u003e\r\n\u003cpre\u003et\r\ne\r\nw\r\ne\r\nt\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 4","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\u003e2 5\r\nabxba\r\nabyba\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 5","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\u003e1 1\r\nz\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\u003c/section\u003e\r\n"}}]}