We have a rectangular grid of squares with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left. On this grid, there is a piece, which is initially placed at square (s_r,s_c).  Takahashi and Aoki will play a game, where each player has a string of length N. Takahashi's string is S, and Aoki's string is T. S and T both consist of four kinds of letters: `L`, `R`, `U` and `D`.  The game consists of N steps. The i-th step proceeds as follows:    * First, Takahashi performs a move. He either moves the piece in the direction of S_i, or does not move the piece.   * Second, Aoki performs a move. He either moves the piece in the direction of T_i, or does not move the piece.  Here, to move the piece in the direction of `L`, `R`, `U` and `D`, is to move the piece from square (r,c) to square (r,c-1), (r,c+1), (r-1,c) and (r+1,c), respectively. If the destination square does not exist, the piece is removed from the grid, and the game ends, even if less than N steps are done.  Takahashi wants to remove the piece from the grid in one of the N steps. Aoki, on the other hand, wants to finish the N steps with the piece remaining on the grid. Determine if the piece will remain on the grid at the end of the game when both players play optimally.
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H, W, N = map(int, input().split())
sr, sc = map(int, input().split())
stS = [v for v in input()[:-1]]
stT = [v for v in input()[:-1]]
stS = stS[::-1]
stT = stT[::-1]

u_lim = 0
d_lim = H

for s, t in zip(stS, stT):
    if t == "U":
        u_lim -= 1
    elif t == "D":
        d_lim += 1
    if s == "U":
        u_lim += 1
    elif t == "D":
        d_lim -= 1

l_lim = 0
r_lim = W

for s, t in zip(stS, stT):
    if t == "R":
        l_lim -= 1
    elif t == "L":
        r_lim += 1
    if s == "R":
        l_lim += 1
    elif t == "L":
        r_lim -= 1

if u_lim <= sr <= d_lim and l_lim <= sr <= r_lim:
    ans = "Yes"
else:
    ans = "No"
print(ans)

# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

H,W,N=map(int,input().split())

sr,sc=map(int,input().split())
S=input()[:-1]
T=input()[:-1]



left=0
right=W+1
up=0
down=H+1

ans="YES"

for s,t in zip(reversed(S),reversed(T)):
    if t=='R':
        left=max(0,left-1)
    elif t=="L":
        right=min(W+1,right+1)
    elif t=="D":
        up = max(0,up-1)
    else:
        down=min(H+1,down+1)


    if s=="R":
        right-=1
    elif s=="L":
        left+=1
    elif s=="D":
        down-=1
    else:
        up+=1

    
    
    if right-left==1 or down-up==1:
        ans="NO"
        break


if not left<sc<right or not up<sr<down:
    ans="NO"
print(ans)
