{"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 a rectangular grid of squares with \u003cvar\u003e\\(H\\)\u003c/var\u003e horizontal rows and \u003cvar\u003e\\(W\\)\u003c/var\u003e vertical columns. Let \u003cvar\u003e\\((i,j)\\)\u003c/var\u003e denote the square at the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th row from the top and the \u003cvar\u003e\\(j\\)\u003c/var\u003e-th column from the left.\r\nOn this grid, there is a piece, which is initially placed at square \u003cvar\u003e\\((s_r,s_c)\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003cp\u003eTakahashi and Aoki will play a game, where each player has a string of length \u003cvar\u003e\\(N\\)\u003c/var\u003e.\r\nTakahashi\u0027s string is \u003cvar\u003e\\(S\\)\u003c/var\u003e, and Aoki\u0027s string is \u003cvar\u003e\\(T\\)\u003c/var\u003e. \u003cvar\u003e\\(S\\)\u003c/var\u003e and \u003cvar\u003e\\(T\\)\u003c/var\u003e both consist of four kinds of letters: \u003ccode\u003eL\u003c/code\u003e, \u003ccode\u003eR\u003c/code\u003e, \u003ccode\u003eU\u003c/code\u003e and \u003ccode\u003eD\u003c/code\u003e.\u003c/p\u003e\r\n\u003cp\u003eThe game consists of \u003cvar\u003e\\(N\\)\u003c/var\u003e steps. The \u003cvar\u003e\\(i\\)\u003c/var\u003e-th step proceeds as follows:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eFirst, Takahashi performs a move. He either moves the piece in the direction of \u003cvar\u003e\\(S_i\\)\u003c/var\u003e, or does not move the piece.\u003c/li\u003e\r\n\u003cli\u003eSecond, Aoki performs a move. He either moves the piece in the direction of \u003cvar\u003e\\(T_i\\)\u003c/var\u003e, or does not move the piece.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eHere, to move the piece in the direction of \u003ccode\u003eL\u003c/code\u003e, \u003ccode\u003eR\u003c/code\u003e, \u003ccode\u003eU\u003c/code\u003e and \u003ccode\u003eD\u003c/code\u003e, is to move the piece from square \u003cvar\u003e\\((r,c)\\)\u003c/var\u003e to square \u003cvar\u003e\\((r,c-1)\\)\u003c/var\u003e, \u003cvar\u003e\\((r,c+1)\\)\u003c/var\u003e, \u003cvar\u003e\\((r-1,c)\\)\u003c/var\u003e and \u003cvar\u003e\\((r+1,c)\\)\u003c/var\u003e, respectively. If the destination square does not exist, the piece is removed from the grid, and the game ends, even if less than \u003cvar\u003e\\(N\\)\u003c/var\u003e steps are done.\u003c/p\u003e\r\n\u003cp\u003eTakahashi wants to remove the piece from the grid in one of the \u003cvar\u003e\\(N\\)\u003c/var\u003e steps.\r\nAoki, on the other hand, wants to finish the \u003cvar\u003e\\(N\\)\u003c/var\u003e steps with the piece remaining on the grid.\r\nDetermine if the piece will remain on the grid at the end of the game when both players play optimally.\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\\(2 \\leq H,W \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(2 \\leq N \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq s_r \\leq H\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq s_c \\leq W\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(|S|\u003d|T|\u003dN\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(S\\)\u003c/var\u003e and \u003cvar\u003e\\(T\\)\u003c/var\u003e consists of the four kinds of letters \u003ccode\u003eL\u003c/code\u003e, \u003ccode\u003eR\u003c/code\u003e, \u003ccode\u003eU\u003c/code\u003e and \u003ccode\u003eD\u003c/code\u003e.\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 \u003cvar\u003e\\(N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(s_r\\)\u003c/var\u003e \u003cvar\u003e\\(s_c\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(S\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(T\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eIf the piece will remain on the grid at the end of the game, 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\u003e2 3 3\r\n2 2\r\nRRL\r\nLUD\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\u003eHere is one possible progress of the game:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eTakahashi moves the piece right. The piece is now at \u003cvar\u003e\\((2,3)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eAoki moves the piece left. The piece is now at \u003cvar\u003e\\((2,2)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eTakahashi does not move the piece. The piece remains at \u003cvar\u003e\\((2,2)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eAoki moves the piece up. The piece is now at \u003cvar\u003e\\((1,2)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eTakahashi moves the piece left. The piece is now at \u003cvar\u003e\\((1,1)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003cli\u003eAoki does not move the piece. The piece remains at \u003cvar\u003e\\((1,1)\\)\u003c/var\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e\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\u003e4 3 5\r\n2 2\r\nUDRRR\r\nLLDUD\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 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 6 11\r\n2 1\r\nRLDRRUDDLRL\r\nURRDRLLDLRD\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\u003c/section\u003e\r\n"}}]}