You were dreaming that you are traveling to a planet named Planetforces on your personal spaceship. Unfortunately, its piloting system was corrupted and now you need to fix it in order to reach Planetforces.

Space can be represented as the $XY$ plane. You are starting at point $(0, 0)$, and Planetforces is located in point $(p_x, p_y)$.

The piloting system of your spaceship follows its list of orders which can be represented as a string $s$. The system reads $s$ from left to right. Suppose you are at point $(x, y)$ and current order is $s_i$:

if $s_i = \text{U}$, you move to $(x, y + 1)$;

if $s_i = \text{D}$, you move to $(x, y - 1)$;

if $s_i = \text{R}$, you move to $(x + 1, y)$;

if $s_i = \text{L}$, you move to $(x - 1, y)$.

Since string $s$ could be corrupted, there is a possibility that you won't reach Planetforces in the end. Fortunately, you can delete some orders from $s$ but you can't change their positions.

Can you delete several orders (possibly, zero) from $s$ in such a way, that you'll reach Planetforces after the system processes all orders?


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of test cases.

Each test case consists of two lines. The first line in each test case contains two integers $p_x$ and $p_y$ ($-10^5 \le p_x, p_y \le 10^5$; $(p_x, p_y) \neq (0, 0)$) — the coordinates of Planetforces $(p_x, p_y)$.

The second line contains the string $s$ ($1 \le |s| \le 10^5$: $|s|$ is the length of string $s$) — the list of orders.

It is guaranteed that the sum of $|s|$ over all test cases does not exceed $10^5$.


-----Output-----

For each test case, print "YES" if you can delete several orders (possibly, zero) from $s$ in such a way, that you'll reach Planetforces. Otherwise, print "NO". You can print each letter in any case (upper or lower).


-----Examples-----

Input
6
10 5
RRRRRRRRRRUUUUU
1 1
UDDDRLLL
-3 -5
LDLDLDDDR
1 2
LLLLUU
3 -2
RDULRLLDR
-1 6
RUDURUUUUR
Output
YES
YES
YES
NO
YES
NO


-----Note-----

In the first case, you don't need to modify $s$, since the given $s$ will bring you to Planetforces.

In the second case, you can delete orders $s_2$, $s_3$, $s_4$, $s_6$, $s_7$ and $s_8$, so $s$ becomes equal to "UR".

In the third test case, you have to delete order $s_9$, otherwise, you won't finish in the position of Planetforces.

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Greedy algorithms


Solutions:
ans = []
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	d = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	s = input()
	for i in s:
		d[i] += 1
	dx = -d['L'] <= x <= d['R']
	dy = -d['D'] <= y <= d['U']
	ans.append(['NO', 'YES'][dx and dy])
print('\n'.join(ans))


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	up = 0
	dow = 0
	rig = 0
	lef = 0
	posible = True
	for i in input():
		if i == 'U' or i == 'D':
			if i == 'U':
				up += 1
			else:
				dow += 1
		elif i == 'R':
			rig += 1
		else:
			lef += 1
	sumax = rig + lef * -1
	while sumax != x and posible == True:
		if x < sumax and rig != 0:
			sumax -= 1
			rig -= 1
		elif x > sumax and lef != 0:
			sumax += 1
			lef -= 1
		else:
			posible = False
	sumay = up + dow * -1
	while sumay != y and posible == True:
		if y < sumay and up != 0:
			sumay -= 1
			up -= 1
		elif y > sumay and dow != 0:
			sumay += 1
			dow -= 1
		else:
			posible = False
	if posible == True:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	(px, py) = map(int, input().split())
	s = str(input())
	n = 1
	if px >= 0:
		if s.count('R') >= px:
			n = 1
		else:
			print('NO')
			continue
	elif s.count('L') >= abs(px):
		n = 1
	else:
		print('NO')
		continue
	if py >= 0:
		if s.count('U') >= py:
			n = n + 1
		else:
			print('NO')
			continue
	elif s.count('D') >= abs(py):
		n = n + 1
	else:
		print('NO')
		continue
	if n == 2:
		print('YES')


import sys
input = sys.stdin.readline
from collections import Counter

def solution(px, py, s):
	c = Counter(s)
	if px < 0 and ('L' not in c or c['L'] < abs(px)):
		print('NO')
		return
	if px > 0 and ('R' not in c or c['R'] < abs(px)):
		print('NO')
		return
	if py < 0 and ('D' not in c or c['D'] < abs(py)):
		print('NO')
		return
	if py > 0 and ('U' not in c or c['U'] < abs(py)):
		print('NO')
		return
	print('YES')
T = int(input())
for t in range(T):
	[px, py] = list(map(int, input().split()))
	s = input()
	solution(px, py, s)


for tc in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	flag1 = False
	flag2 = False
	(r, u, d, l) = (s.count('R'), s.count('U'), s.count('D'), s.count('L'))
	if x >= 0 and r >= x or (x <= 0 and l >= abs(x)):
		flag1 = True
	if y >= 0 and u >= y or (y <= 0 and d >= abs(y)):
		flag2 = True
	if flag1 and flag2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = list(map(int, input().split()))
	s = input()
	(l, d, r, u) = (0, 0, 0, 0)
	for i in s:
		if i == 'L':
			l += 1
		elif i == 'D':
			d += 1
		elif i == 'R':
			r += 1
		elif i == 'U':
			u += 1
	if x <= 0 and y <= 0 and (l >= abs(x)) and (d >= abs(y)):
		print('YES')
	elif x <= 0 and y >= 0 and (l >= abs(x)) and (u >= abs(y)):
		print('YES')
	elif x >= 0 and y <= 0 and (r >= abs(x)) and (d >= abs(y)):
		print('YES')
	elif x >= 0 and y >= 0 and (r >= abs(x)) and (u >= abs(y)):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(x, y) = [int(i) for i in input().split()]
	s = input()
	(l, r, u, d, ox_check, oy_check) = [0, 0, 0, 0, True, True]
	for i in range(len(s)):
		if s[i] == 'L':
			l += 1
		elif s[i] == 'R':
			r += 1
		elif s[i] == 'U':
			u += 1
		else:
			d += 1
	if x < 0 and abs(l) < abs(x) or (x >= 0 and r < x):
		ox_check = False
	if y < 0 and abs(d) < abs(y) or (y >= 0 and u < y):
		oy_check = False
	if ox_check and oy_check:
		print('YES')
	else:
		print('NO')


def solve(px, py, s):
	y1 = s.count('U')
	y2 = s.count('D')
	x1 = s.count('R')
	x2 = s.count('L')
	if -x2 <= px <= x1 and -y2 <= py <= y1:
		return 'YES'
	return 'NO'
t = int(input())
for i in range(t):
	(px, py) = map(int, input().split())
	s = input()
	print(solve(px, py, s))


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	s = input().rstrip()
	(cx, cy) = (0, 0)
	(dx, dy) = (None, None)
	if x >= 0:
		dx = 'R'
	else:
		dx = 'L'
	if y >= 0:
		dy = 'U'
	else:
		dy = 'D'
	ok = False
	for ch in s:
		if ch == 'U' and dy == 'U':
			cy += 1
		elif ch == 'D' and dy == 'D':
			cy -= 1
		elif ch == 'R' and dx == 'R':
			cx += 1
		elif ch == 'L' and dx == 'L':
			cx -= 1
	if abs(cx) >= abs(x) and abs(cy) >= abs(y):
		ok = True
	if ok:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	t = input()
	print('YES' if t.count('U') >= y and t.count('D') >= -y and (t.count('R') >= x) and (t.count('L') >= -x) else 'NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	s = ''.join(sorted(list(s)))
	if x > 0:
		m1 = 'R' * x
	else:
		m1 = 'L' * abs(x)
	if y > 0:
		m2 = 'U' * y
	else:
		m2 = 'D' * abs(y)
	if m1 in s and m2 in s:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	(a, b, c, d) = (0, 0, 0, 0)
	for i in s:
		a += i == 'R'
		b += i == 'L'
		c += i == 'U'
		d += i == 'D'
	if x < 0:
		if y < 0:
			print('YES' if b >= -x and d >= -y else 'NO')
		else:
			print('YES' if b >= -x and c >= y else 'NO')
	elif y < 0:
		print('YES' if a >= x and d >= -y else 'NO')
	else:
		print('YES' if a >= x and c >= y else 'NO')


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(*ele, end='\n')
for _ in range(L()[0]):
	(px, py) = L()
	A = input()
	l = A.count('L')
	r = A.count('R')
	d = A.count('D')
	u = A.count('U')
	ans = 'NO'
	if -l <= px <= r:
		if -d <= py <= u:
			ans = 'YES'
	print(ans)
endtime = time.time()


def solve(goal_x, goal_y, order):
	move = {'U': 0, 'D': 0, 'L': 0, 'R': 0}
	for o in order:
		move[o] += 1
	lr_pos = True
	ud_pos = True
	if goal_x < 0 and move['L'] < abs(goal_x) or (goal_x > 0 and move['R'] < abs(goal_x)):
		lr_pos = False
	if goal_y < 0 and move['D'] < abs(goal_y) or (goal_y > 0 and move['U'] < abs(goal_y)):
		ud_pos = False
	return lr_pos and ud_pos
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	s = input()
	possible = solve(x, y, s)
	if possible:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = list(map(int, input().split(' ')))
	x_coordinate = int(a[0])
	y_coordinate = int(a[1])
	str = input()
	u = 0
	d = 0
	r = 0
	l = 0
	for j in str:
		if j == 'U':
			u += 1
		elif j == 'D':
			d -= 1
		elif j == 'R':
			r += 1
		elif j == 'L':
			l -= 1
	if l <= x_coordinate <= r and d <= y_coordinate <= u:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t -= 1
	n = input().split()
	x = int(n[0])
	y = int(n[1])
	s = input()
	r = s.count('R')
	ll = s.count('L')
	d = s.count('D')
	u = s.count('U')
	b = True
	if x < 0 and ll < abs(x):
		b = False
	elif x > 0 and r < x:
		b = False
	if y < 0 and d < abs(y):
		b = False
	elif y > 0 and u < y:
		b = False
	if b:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y) = (int(_) for _ in input().split(' '))
	order = input()
	flag = True
	if flag:
		flag = order.count('R') >= x if x > 0 else order.count('L') >= -x
	if flag:
		flag = order.count('U') >= y if y > 0 else order.count('D') >= -y
	print('YES' if flag else 'NO')


a = int(input())
for b in range(a):
	(x, y) = [int(i) for i in input().split()]
	d = input()
	if d.count('U') >= y and y > 0:
		y = 0
	if d.count('D') >= -y and y < 0:
		y = 0
	if d.count('R') >= x and x > 0:
		x = 0
	if d.count('L') >= -x and x < 0:
		x = 0
	if x == 0 and y == 0:
		print('YES')
	else:
		print('NO')


def inl():
	return [int(i) for i in input().split()]

def inp():
	return int(input())
for _ in range(inp()):
	(px, py) = inl()
	s = input()
	cnt = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	for i in s:
		cnt[i] += 1
	flg1 = 0
	flg2 = 0
	if px > 0:
		if cnt['R'] >= px:
			flg1 = 1
	elif cnt['L'] >= abs(px):
		flg1 = 1
	if py > 0:
		if cnt['U'] >= py:
			flg2 = 1
	elif cnt['D'] >= abs(py):
		flg2 = 1
	if flg1 and flg2:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(px, py) = map(int, input().split())
	l = input()
	x = 0
	y = 0
	(u, d, le, r) = (0, 0, 0, 0)
	for i in range(len(l)):
		if l[i] == 'U':
			y += 1
			u += 1
		elif l[i] == 'D':
			y -= 1
			d += 1
		elif l[i] == 'L':
			x -= 1
			le += 1
		elif l[i] == 'R':
			x += 1
			r += 1
	if x == px and y == py:
		print('YES')
	else:
		flag = True
		if x < px and px - x > le:
			flag = False
		if y < py and py - y > d:
			flag = False
		if x > px and x - px > r:
			flag = False
		if y > py and y - py > u:
			flag = False
		if flag:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	(ex, ey) = map(int, input().split())
	string = input()
	istruex = False
	istruey = False
	if ex < 0:
		a = string.count('L')
		if a >= abs(ex):
			istruex = True
	else:
		a = string.count('R')
		if a >= abs(ex):
			istruex = True
	if ey < 0:
		a = string.count('D')
		if a >= abs(ey):
			istruey = True
	else:
		a = string.count('U')
		if a >= abs(ey):
			istruey = True
	print('YES' if istruex and istruey else 'NO')


for __ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	(u, l, d, r) = (0, 0, 0, 0)
	for i in s:
		if i == 'U':
			u += 1
		elif i == 'R':
			r += 1
		elif i == 'D':
			d += 1
		else:
			l += 1
	if 0 < x <= r:
		x = 0
	if x < 0 and l >= -x:
		x = 0
	if y > 0 and u >= y:
		y = 0
	if y < 0 and d >= -y:
		y = 0
	print('YES' if not x and (not y) else 'NO')


def opr(x, y):
	mas = {'x': 0, 'y': 0}
	if x > 0:
		mas['x'] = 1
	if y > 0:
		mas['y'] = 1
	return mas
out = []
t = int(input())
for i in range(t):
	(x, y) = input().split()
	(x, y) = (int(x), int(y))
	string = input()
	mas = opr(x, y)
	if mas['x'] == 1 and mas['y'] == 1 and (string.count('R') >= x) and (string.count('U') >= y):
		out.append('YES')
	elif mas['x'] == 0 and mas['y'] == 1 and (string.count('L') >= -x) and (string.count('U') >= y):
		out.append('YES')
	elif mas['x'] == 1 and mas['y'] == 0 and (string.count('R') >= x) and (string.count('D') >= -y):
		out.append('YES')
	elif mas['x'] == 0 and mas['y'] == 0 and (string.count('L') >= -x) and (string.count('D') >= -y):
		out.append('YES')
	else:
		out.append('NO')
for i in out:
	print(i)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()

def RL():
	return map(int, sys.stdin.readline().split())

def RLL():
	return list(map(int, sys.stdin.readline().split()))

def N():
	return int(input())

def S():
	return input().strip()

def print_list(l):
	print(' '.join(map(str, l)))
from collections import Counter
for _ in range(N()):
	(x, y) = RL()
	s = S()
	dic = Counter(s)
	if x > 0:
		if dic['R'] < x:
			print('NO')
			continue
	elif dic['L'] < -x:
		print('NO')
		continue
	if y > 0:
		if dic['U'] < y:
			print('NO')
			continue
	elif dic['D'] < -y:
		print('NO')
		continue
	print('YES')


import sys
input = sys.stdin.readline

def solve():
	(px, py) = map(int, input().split())
	s = input().strip()
	R = U = L = D = 0
	n = len(s)
	for i in range(n):
		if s[i] == 'R':
			R += 1
		elif s[i] == 'U':
			U += 1
		elif s[i] == 'L':
			L += 1
		else:
			D += 1
	a = b = False
	if px >= 0 and R >= px:
		a = True
	elif px < 0 and L >= abs(px):
		a = True
	if py >= 0 and U >= py:
		b = True
	elif py < 0 and D >= abs(py):
		b = True
	return 'YES' if a and b else 'NO'
for _ in range(int(input())):
	print(solve())


t = int(input())
q = 0
z = []
while q < t:
	(px, py) = map(int, input().split(' '))
	order = input()
	x = order.count('R') - order.count('L')
	y = order.count('U') - order.count('D')
	if px <= x:
		if x - px <= order.count('R'):
			xo = 1
		else:
			xo = 0
	elif px - x <= order.count('L'):
		xo = 1
	else:
		xo = 0
	if py <= y:
		if y - py <= order.count('U'):
			yo = 1
		else:
			yo = 0
	elif py - y <= order.count('D'):
		yo = 1
	else:
		yo = 0
	if yo * xo == 1:
		z.append('YES')
	else:
		z.append('NO')
	q = q + 1
for j in z:
	print(j)


t = int(input())
for _ in range(t):
	(a, b) = [int(i) for i in input().split()]
	s = str(input())
	if a > 0:
		s1 = 'R'
	elif a < 0:
		s1 = 'L'
	if b > 0:
		s2 = 'U'
	elif b < 0:
		s2 = 'D'
	ns1 = abs(a)
	ns2 = abs(b)
	if s.count(s1) >= ns1 and s.count(s2) >= ns2:
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(t):
	(px, py) = map(int, input().split())
	s = str(input())
	u = s.count('U')
	d = s.count('D')
	r = s.count('R')
	l = s.count('L')
	if px >= 0 and py >= 0:
		if r >= px and u >= py:
			print('YES')
		else:
			print('NO')
	elif px < 0 and py < 0:
		if l >= abs(px) and d >= abs(py):
			print('YES')
		else:
			print('NO')
	elif px >= 0 and py < 0:
		if r >= px and d >= abs(py):
			print('YES')
		else:
			print('NO')
	elif px < 0 and py >= 0:
		if l >= abs(px) and u >= py:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	if x > 0 and s.count('R') < x or (x < 0 and s.count('L') < abs(x)) or (y > 0 and s.count('U') < y) or (y < 0 and s.count('D') < abs(y)):
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	xpossible = 0
	ypossible = 0
	(goalx, goaly) = input().split()
	orders = input()
	if int(goalx) == 0:
		xpossible = 1
	elif int(goalx) < 0:
		orderL = 0
		for each_order in orders:
			if each_order == 'L':
				orderL += -1
		if orderL <= int(goalx):
			xpossible = 1
	else:
		orderR = 0
		for each_order in orders:
			if each_order == 'R':
				orderR += 1
		if orderR >= int(goalx):
			xpossible = 1
	if int(goaly) == 0:
		ypossible = 1
	elif int(goaly) < 0:
		orderD = 0
		for each_order in orders:
			if each_order == 'D':
				orderD += -1
		if orderD <= int(goaly):
			ypossible = 1
	else:
		orderU = 0
		for each_order in orders:
			if each_order == 'U':
				orderU += 1
		if orderU >= int(goaly):
			ypossible = 1
	if xpossible == 1 and ypossible == 1:
		print('YES')
	else:
		print('NO')


def solve(px, py, s):
	if px > 0:
		if s.count('R') < px:
			return False
	elif s.count('L') < -px:
		return False
	if py > 0:
		if s.count('U') < py:
			return False
	elif s.count('D') < -py:
		return False
	return True

def driver():
	t = int(input())
	for _ in range(t):
		(px, py) = map(int, input().split())
		s = input()
		if solve(px, py, s):
			print('YES')
		else:
			print('NO')

def test():
	assert solve(10, 5, 'RRRRRRRRRRUUUUU')
	assert solve(1, 1, 'UDDDRLLL')
	assert solve(-3, -5, 'LDLDLDDDR')
	assert not solve(1, 2, 'LLLLUU')
	assert solve(3, -2, 'RDULRLLDR')
	assert not solve(-1, 6, 'RUDURUUUUR')
driver()


t = int(input())
for o in range(t):
	p = [int(x) for x in input().split()]
	s = input()
	m = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	for x in s:
		m[x] += 1
	y = ''
	x = ''
	if p[0] < 0:
		x = 'L'
		p[0] *= -1
	else:
		x = 'R'
	if p[1] < 0:
		y = 'D'
		p[1] *= -1
	else:
		y = 'U'
	if m[x] >= p[0] and m[y] >= p[1]:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	(sx, sy) = (0, 0)
	s = input()
	r1 = l1 = u1 = d1 = 0
	(r, l, u, d) = (s.count('R'), s.count('L'), s.count('U'), s.count('D'))
	if x > 0:
		r1 += x
	if x < 0:
		l1 -= x
	if y < 0:
		d1 -= y
	if y > 0:
		u1 += y
	print('Yes' if r1 <= r and l1 <= l and (u1 <= u) and (d1 <= d) else 'No')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	(x, y) = value()
	s = input()
	(R, L, U, D) = (0, 0, 0, 0)
	if x > 0:
		R = x
	if x < 0:
		L = -x
	if y > 0:
		U = y
	if y < 0:
		D = -y
	r = s.count('R')
	l = s.count('L')
	u = s.count('U')
	d = s.count('D')
	if R <= r and L <= l and (U <= u) and (D <= d):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	s = input()
	(mn_x, mx_x) = (s.count('L'), s.count('R'))
	(mn_y, mx_y) = (s.count('D'), s.count('U'))
	print('YES') if -mn_x <= x <= mx_x and -mn_y <= y <= mx_y else print('NO')


from collections import defaultdict
for _ in range(int(input())):
	(px, py) = map(int, input().split())
	s = input()
	dic = defaultdict(lambda : 0)
	(x, y) = (0, 0)
	for el in s:
		if el == 'U':
			y += 1
		elif el == 'D':
			y -= 1
		elif el == 'R':
			x += 1
		else:
			x -= 1
		dic[el] += 1
	(xn, yn) = (px - x, py - y)
	ans = 'YES'
	if xn > 0:
		if dic['L'] < xn:
			ans = 'NO'
	elif xn < 0:
		if dic['R'] < abs(xn):
			ans = 'NO'
	if yn > 0:
		if dic['D'] < yn:
			ans = 'NO'
	elif yn < 0:
		if dic['U'] < abs(yn):
			ans = 'NO'
	print(ans)


t = int(input())
while t:
	(x, y) = list(map(int, input().split()))
	s = input()
	(L, R, U, D) = (0, 0, 0, 0)
	for ch in s:
		if ch == 'L':
			L += 1
		elif ch == 'R':
			R += 1
		elif ch == 'U':
			U += 1
		else:
			D += 1
	ans = 'NO'
	if x >= 0 and y >= 0 and (R >= abs(x)) and (U >= abs(y)):
		ans = 'YES'
	elif x < 0 and y >= 0 and (L >= abs(x)) and (U >= abs(y)):
		ans = 'YES'
	elif x < 0 and y < 0 and (L >= abs(x)) and (D >= abs(y)):
		ans = 'YES'
	elif x >= 0 and y < 0 and (R >= abs(x)) and (D >= abs(y)):
		ans = 'YES'
	print(ans)
	t -= 1


i = int(input())
for _ in range(i):
	(x, y) = map(int, input().split())
	s = input().upper()
	p = 0
	if x >= 0 and s.count('R') >= x or (x <= 0 and s.count('L') >= -x):
		p = p + 1
	if y >= 0 and s.count('U') >= y or (y <= 0 and s.count('D') >= -y):
		p = p + 1
	if p == 2:
		print('YES')
	else:
		print('NO')


from sys import stdin
_input = stdin.readline
(_range, _dict, _int, _str) = (range, dict, int, str)
from collections import defaultdict

def solution():
	for _ in _range(_int(_input())):
		(n, k) = [_int(i) for i in _input().split()]
		d = defaultdict(_int)
		for i in _input().rstrip('\n'):
			d[i] += 1
		x = False
		y = False
		if n > 0:
			if d['R'] >= n:
				x = True
		elif d['L'] >= -n:
			x = True
		if k > 0:
			if d['U'] >= k:
				y = True
		elif d['D'] >= -k:
			y = True
		if x and y:
			print('YES')
		else:
			print('NO')
solution()


from collections import Counter
numOfTests = int(input())
for i in range(numOfTests):
	(x, y) = map(int, input().split())
	steps = input()
	counts = Counter(steps)
	if x >= 0 and y >= 0:
		if counts['R'] >= x and counts['U'] >= y:
			print('YES')
		else:
			print('NO')
	elif x <= 0 and y <= 0:
		if counts['L'] >= abs(x) and counts['D'] >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x >= 0 and y <= 0:
		if counts['R'] >= x and counts['D'] >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x <= 0 and y >= 0:
		if counts['L'] >= abs(x) and counts['U'] >= y:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	U = 0
	D = 0
	R = 0
	L = 0
	(Px, Py) = map(int, input().split())
	s = input()
	for j in s:
		if j == 'U':
			U += 1
		elif j == 'D':
			D -= 1
		elif j == 'R':
			R += 1
		elif j == 'L':
			L -= 1
	if D <= Py <= U and L <= Px <= R:
		print('YES')
	else:
		print('NO')


def NbOcc(chaine, elem):
	nb = 0
	for e in chaine:
		if elem == e:
			nb = nb + 1
	return nb
n = input()
n = int(n)
res = []
for i in range(0, n):
	E = set()
	coord = input().split()
	coord[0] = int(coord[0])
	coord[1] = int(coord[1])
	commandes = input()
	x = 0
	y = 0
	s = ''
	while x != coord[0]:
		if coord[0] < 0:
			x = x - 1
			s = s + 'L'
			E.add('L')
		else:
			x = x + 1
			s = s + 'R'
			E.add('R')
	while y != coord[1]:
		if coord[1] > 0:
			y = y + 1
			s = s + 'U'
			E.add('U')
		else:
			y = y - 1
			s = s + 'D'
			E.add('D')
	if len(commandes) < len(s):
		res.append('NO')
	else:
		b = True
		for c in E:
			if NbOcc(s, c) > NbOcc(commandes, c):
				b = False
				res.append('NO')
				break
		if b:
			res.append('YES')
for c in res:
	print(c)


for i in range(int(input())):
	(px, py) = map(int, input().split())
	s = list(input())
	ans = 'YES'
	if px > 0:
		if s.count('R') < px:
			ans = 'NO'
	elif s.count('L') < abs(px):
		ans = 'NO'
	if py > 0:
		if s.count('U') < py:
			ans = 'NO'
	elif s.count('D') < abs(py):
		ans = 'NO'
	print(ans)


t = int(input())
for _ in range(t):
	(px, py) = [int(i) for i in input().split()]
	s = input()
	orderDict = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	for i in s:
		orderDict[i] += 1
	if 0 <= px <= orderDict['R'] and 0 <= py <= orderDict['U']:
		print('YES')
	elif 0 <= px <= orderDict['R'] and -1 * orderDict['D'] <= py <= 0:
		print('YES')
	elif -1 * orderDict['L'] <= px <= 0 and 0 <= py <= orderDict['U']:
		print('YES')
	elif -1 * orderDict['L'] <= px <= 0 and -1 * orderDict['D'] <= py <= 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	s = input()
	up = s.count('U')
	down = s.count('D')
	left = s.count('L')
	right = s.count('R')
	if -left <= x <= right and -down <= y <= up:
		print('YES')
	else:
		print('NO')


from collections import Counter
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	a = list(input().rstrip())
	b = Counter(a)
	if x >= 0 and y >= 0 and (b['R'] >= x) and (b['U'] >= y):
		print('YES')
	elif x >= 0 and y <= 0 and (b['R'] >= x) and (b['D'] >= -y):
		print('YES')
	elif x <= 0 and y >= 0 and (b['L'] >= -x) and (b['U'] >= y):
		print('YES')
	elif x <= 0 and y <= 0 and (b['L'] >= -x) and (b['D'] >= -y):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	st = input()
	r = st.count('R')
	u = st.count('U')
	d = st.count('D')
	l = st.count('L')
	if n > 0:
		if m > 0:
			if r >= n and u >= m:
				print('YES')
			else:
				print('NO')
		else:
			m *= -1
			if r >= n and d >= m:
				print('YES')
			else:
				print('NO')
	else:
		n *= -1
		if m > 0:
			if l >= n and u >= m:
				print('YES')
			else:
				print('NO')
		else:
			m *= -1
			if l >= n and d >= m:
				print('YES')
			else:
				print('NO')


for _ in range(int(input())):
	(px, py) = map(int, input().split())
	s = input()
	if px <= 0 and py <= 0 and (s.count('L') >= abs(px)) and (s.count('D') >= abs(py)):
		print('YES')
	elif px <= 0 and py >= 0 and (s.count('L') >= abs(px)) and (s.count('U') >= abs(py)):
		print('YES')
	elif px >= 0 and py <= 0 and (s.count('R') >= abs(px)) and (s.count('D') >= abs(py)):
		print('YES')
	elif px >= 0 and py >= 0 and (s.count('R') >= abs(px)) and (s.count('U') >= abs(py)):
		print('YES')
	else:
		print('NO')


for o in range(int(input())):
	(px, py) = map(int, input().split())
	instructions = input()
	x = 0
	y = 0
	for instruction in instructions:
		if px < 0:
			if instruction == 'L':
				x -= 1
		elif px > 0:
			if instruction == 'R':
				x += 1
		if py < 0:
			if instruction == 'D':
				y -= 1
		elif py > 0:
			if instruction == 'U':
				y += 1
	if px < 0:
		if x <= px:
			xx = True
		else:
			xx = False
	elif x >= px:
		xx = True
	else:
		xx = False
	if py < 0:
		if y <= py:
			yy = True
		else:
			yy = False
	elif y >= py:
		yy = True
	else:
		yy = False
	if xx and yy:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(px, py) = map(int, input().split())
	s = input()
	e1 = 0
	e2 = 0
	if px <= 0:
		e1 = s.count('L')
	if px > 0:
		e1 = s.count('R')
	if py <= 0:
		e2 = s.count('D')
	if py > 0:
		e2 = s.count('U')
	px = abs(px)
	py = abs(py)
	if e1 >= px and e2 >= py:
		sys.stdout.write('YES' + '\n')
		continue
	sys.stdout.write('NO' + '\n')


a = int(input())
for x in range(a):
	l = [0, 0, 0, 0]
	(b, c) = map(int, input().split())
	d = input()
	if b == 0:
		if c < 0:
			l[3] = abs(c)
		else:
			l[1] = abs(c)
	elif b > 0:
		if c < 0:
			l[0] = abs(b)
			l[3] = abs(c)
		else:
			l[0] = abs(b)
			l[1] = abs(c)
	elif b < 0:
		if c < 0:
			l[2] = abs(b)
			l[3] = abs(c)
		else:
			l[2] = abs(b)
			l[1] = abs(c)
	t = 0
	if d.count('R') < l[0]:
		t += 1
	if d.count('U') < l[1]:
		t += 1
	if d.count('L') < l[2]:
		t += 1
	if d.count('D') < l[3]:
		t += 1
	if t > 0:
		print('NO')
	else:
		print('YES')


repeat = int(input())
for rep in range(repeat):
	(x, y) = map(int, input().split())
	direction = input()
	x_dir = '2'
	y_dir = '23'
	if x < 0:
		x_dir = 'L'
	else:
		x_dir = 'R'
	if y < 0:
		y_dir = 'D'
	else:
		y_dir = 'U'
	if direction.count(x_dir) >= abs(x) and direction.count(y_dir) >= abs(y):
		print('YES')
	else:
		print('NO')


t = int(input())

def is_possible(s, px, r, l):
	can_get = True
	if px > 0:
		if s.count(r) < px:
			can_get = False
	elif s.count(l) < -px:
		can_get = False
	return can_get
for i in range(t):
	s = input().split(' ')
	px = int(s[0])
	py = int(s[-1])
	s = input()
	if is_possible(s, px, 'R', 'L') & is_possible(s, py, 'U', 'D'):
		print('YES')
	else:
		print('NO')


import sys
import os
import math
import copy
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations, accumulate

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def watch(x):
	return print(x)

def common(l1, l2):
	return set(l1).intersection(l2)

def Most_frequent(list):
	return max(set(list), key=list.count)

def solution():
	for _ in range(Int()):
		(x, y) = Mint()
		s = Lstr()
		(x1, y1) = (0, 0)
		p = 0
		for i in range(len(s)):
			if s[i] == 'U' and y1 < y:
				y1 += 1
			elif s[i] == 'L' and x1 > x:
				x1 -= 1
			elif s[i] == 'R' and x1 < x:
				x1 += 1
			elif s[i] == 'D' and y1 > y:
				y1 -= 1
		if x1 == x and y1 == y:
			print('YES')
		else:
			print('NO')
solution()


import sys
whole_input = sys.stdin.readlines()
t = int(whole_input[0])
for i in range(t):
	line_a = whole_input[2 * i + 1].strip()
	line_b = whole_input[2 * i + 2].strip()
	line_a_splitted = line_a.split()
	px = int(line_a_splitted[0])
	py = int(line_a_splitted[1])
	dir_u = line_b.count('U')
	dir_d = line_b.count('D')
	dir_l = line_b.count('L')
	dir_r = line_b.count('R')
	if py > 0 and py > dir_u:
		print('NO')
		continue
	if py < 0 and -py > dir_d:
		print('NO')
		continue
	if px > 0 and px > dir_r:
		print('NO')
		continue
	if px < 0 and -px > dir_l:
		print('NO')
		continue
	print('YES')


lst = ['U', 'D', 'R', 'L']
t = int(input())
for _ in range(t):
	(x, y) = [int(x) for x in input().split()]
	s = input()
	firstMove = 'R' if x > 0 else 'L'
	secondMove = 'U' if y > 0 else 'D'
	x = abs(x)
	y = abs(y)
	flag = False
	for i in s:
		if i == firstMove and x > 0:
			x -= 1
		elif i == secondMove and y > 0:
			y -= 1
		if x == 0 and y == 0:
			flag = True
			break
	print('YES' if flag else 'NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res) % MOD

def comb(n, x):
	(a, b) = (1, 1)
	for i in range(1, x + 1):
		a *= n + 1 - i
		b *= i
	return a // b % MOD

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
small = 'abcdefghijklmnopqrstuvwxyz'
large = small.upper()
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	(px, py) = read()
	s = string()
	xsump = 0
	xsumn = 0
	ysump = 0
	ysumn = 0
	for x in s:
		if x == 'R':
			xsump += 1
		elif x == 'L':
			xsumn -= 1
		elif x == 'U':
			ysump += 1
		elif x == 'D':
			ysumn -= 1
	if (px <= xsump and px >= xsumn) and (py <= ysump and py >= ysumn):
		print('YES')
	else:
		print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
t = scanner()
for i in range(t):
	solve()


test_case = int(input())
for i in range(test_case):
	(px, py) = map(int, input().split())
	string = str(input())
	r = string.count('R')
	l = string.count('L')
	u = string.count('U')
	d = string.count('D')
	if px >= 0 and py >= 0:
		if r >= px and u >= py:
			print('YES')
		else:
			print('NO')
	elif px < 0 and py < 0:
		x = abs(px)
		y = abs(py)
		if l >= x and d >= y:
			print('YES')
		else:
			print('NO')
	elif px < 0 and py >= 0:
		x = abs(px)
		if l >= x and u >= py:
			print('YES')
		else:
			print('NO')
	else:
		y = abs(py)
		if r >= px and d >= y:
			print('YES')
		else:
			print('NO')


t = int(input())
for j in range(t):
	(x, y) = list(map(int, input().strip().split()))[:2]
	s = input()
	(u, d, r, l) = (s.count('U'), s.count('D'), s.count('R'), s.count('L'))
	if -l <= x <= r and -d <= y <= u:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	t = 1
	if x < 0 and abs(x) > s.count('L'):
		t = 0
	elif x > s.count('R'):
		t = 0
	if y < 0 and abs(y) > s.count('D'):
		t = 0
	elif y > s.count('U'):
		t = 0
	print('YES' if t else 'NO')


import collections
tc = int(input())
for ti in range(tc):
	(x, y) = [int(i) for i in input().split()]
	str = collections.Counter(input())
	if -str['D'] <= y <= str['U'] and -str['L'] <= x <= str['R']:
		print('YES')
	else:
		print('NO')


t = int(input())
for inh in range(0, t):
	(x, y) = map(int, input().split())
	s = input()
	r = s.count('R')
	l = s.count('L')
	u = s.count('U')
	d = s.count('D')
	ans = True
	if x < 0:
		if abs(x) > l:
			ans = False
	elif x > r:
		ans = False
	if y < 0:
		if abs(y) > d:
			ans = False
	elif y > u:
		ans = False
	if ans:
		print('YES')
	else:
		print('NO')


T = int(input())
for i in range(T):
	(a, b) = input().split()
	s = input()
	a = int(a)
	b = int(b)
	destination = [a, b]
	commands = {'L': 0, 'D': 0, 'U': 0, 'R': 0}
	required_l = 0
	required_r = 0
	required_u = 0
	required_d = 0
	for alph in s:
		commands[alph] += 1
	if destination[0] - 0 < 0:
		required_l = 0 - destination[0]
	if destination[0] - 0 >= 0:
		required_r = destination[0]
	if destination[1] - 0 < 0:
		required_d = 0 - destination[1]
	if destination[1] - 0 >= 0:
		required_u = destination[1]
	if required_l <= commands['L'] and required_d <= commands['D'] and (required_r <= commands['R']) and (required_u <= commands['U']):
		print('YES')
	else:
		print('NO')


import collections

def solve(p_x, p_y, s):
	freq_map = collections.Counter(s)
	if p_x > 0:
		if freq_map['R'] < p_x:
			return 'NO'
	elif p_x < 0:
		if freq_map['L'] < abs(p_x):
			return 'NO'
	if p_y > 0:
		if freq_map['U'] < p_y:
			return 'NO'
	elif p_y < 0:
		if freq_map['D'] < abs(p_y):
			return 'NO'
	return 'YES'
t = int(input())
for _ in range(0, t):
	(p_x, p_y) = map(int, input().split(' '))
	s = list(input())
	print(solve(p_x, p_y, s))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(x, y) = map(int, sys.stdin.readline().split())
	moves = sys.stdin.readline()
	(max_x, max_y) = (0, 0)
	(min_x, min_y) = (0, 0)
	for c in moves:
		if c == 'U':
			max_y += 1
		elif c == 'D':
			min_y -= 1
		elif c == 'R':
			max_x += 1
		elif c == 'L':
			min_x -= 1
	print('YES' if max_x >= x >= min_x and max_y >= y >= min_y else 'NO')


for _ in range(int(input())):
	(x, y) = list(map(int, input().split()))
	data = list(input())
	n = len(data)
	deltaX = 0
	deltaY = 0
	ls = 0
	rs = 0
	us = 0
	ds = 0
	for i in range(n):
		if data[i] == 'U':
			deltaY += 1
			us += 1
		elif data[i] == 'D':
			deltaY -= 1
			ds += 1
		elif data[i] == 'L':
			deltaX -= 1
			ls += 1
		else:
			deltaX += 1
			rs += 1
	fl1 = False
	fl2 = False
	if x < 0:
		if deltaX - rs <= x:
			fl1 = True
	elif deltaX + ls >= x:
		fl1 = True
	if y < 0:
		if deltaY - us <= y:
			fl2 = True
	elif deltaY + ds >= y:
		fl2 = True
	if fl1 and fl2:
		print('YES')
	else:
		print('NO')


from collections import Counter

def yesno(x, y, s):
	if x > 0 and s['R'] < x:
		return 'NO'
	if y > 0 and s['U'] < y:
		return 'NO'
	if x < 0 and s['L'] < abs(x):
		return 'NO'
	if y < 0 and s['D'] < abs(y):
		return 'NO'
	return 'YES'
n = int(input())
for i in range(n):
	(x, y) = map(int, input().split())
	s = Counter(input())
	print(yesno(x, y, s))


t = int(input())
for i in range(t):
	(X, Y) = [int(i) for i in input().split()]
	s = input()
	x = s.count('R')
	x_ = -s.count('L')
	y = s.count('U')
	y_ = -s.count('D')
	if (x_ <= X and X <= x) and (y_ <= Y and Y <= y):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y) = list(map(int, input().split()))
	s = input()
	u = s.count('U')
	d = -1 * s.count('D')
	r = s.count('R')
	l = -1 * s.count('L')
	if x >= 0 and x <= r or (x <= 0 and x >= l):
		j = 1
	else:
		j = -1
	if y >= 0 and y <= u or (y <= 0 and y >= d):
		k = 1
	else:
		k = -1
	if k == 1 and j == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(px, py) = list(map(int, input().split()))
	s = input()
	print('YNEOS'[[s.count('L'), s.count('R')][px >= 0] < abs(px) or [s.count('D'), s.count('U')][py >= 0] < abs(py)::2])


for _ in range(int(input())):
	(p, q) = map(int, input().split())
	s = list(input())
	print('YNEOS'[not (-s.count('L') <= p <= s.count('R') and -s.count('D') <= q <= s.count('U'))::2])


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	string = input().strip()
	u = string.count('U')
	d = string.count('D')
	r = string.count('R')
	l = string.count('L')
	x1 = r - l
	y1 = u - d
	if (0 <= x1 - x <= r or 0 <= x - x1 <= l) and (0 <= y1 - y <= u or 0 <= y - y1 <= d):
		print('YES')
	else:
		print('NO')


tests = int(input())
for _ in range(tests):
	(p1, p2) = list(map(int, input().split()))
	for c in list(input()):
		if p1 > 0 and c == 'R':
			p1 -= 1
		elif p1 < 0 and c == 'L':
			p1 += 1
		if p2 > 0 and c == 'U':
			p2 -= 1
		elif p2 < 0 and c == 'D':
			p2 += 1
		if not p1 and (not p2):
			break
	print('YES' if not p1 and (not p2) else 'NO')


import sys
input = sys.stdin.readline
from collections import *
for _ in range(int(input())):
	(px, py) = map(int, input().split())
	s = input()[:-1]
	U = s.count('U')
	D = s.count('D')
	L = s.count('L')
	R = s.count('R')
	if -D <= py <= U and -L <= px <= R:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = str(input())
	u = d = l = r = 0
	for i in range(len(s)):
		if s[i] == 'U':
			u += 1
		elif s[i] == 'D':
			d += 1
		elif s[i] == 'L':
			l += 1
		else:
			r += 1
	if x > 0 and r >= x:
		x = 0
	if x < 0 and l >= -x:
		x = 0
	if y > 0 and u >= y:
		y = 0
	if y < 0 and d >= -y:
		y = 0
	print('YES' if x == 0 and y == 0 else 'NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	(l, r, d, u) = (0, 0, 0, 0)
	for c in s:
		if c == 'L':
			l += 1
		elif c == 'R':
			r += 1
		elif c == 'D':
			d += 1
		else:
			u += 1
	if x >= 0 and r >= x or (x < 0 and l >= -x):
		x = 0
	if y >= 0 and u >= y or (y < 0 and d >= -y):
		y = 0
	print('YES' if not x and (not y) else 'NO')


def solve(px, py, cor):
	xDistance = range(-cor.count('L'), cor.count('R') + 1)
	yDistance = range(-cor.count('D'), cor.count('U') + 1)
	return 'YES' if px in xDistance and py in yDistance else 'NO'
T = int(input())
for _ in range(T):
	(px, py) = list(map(int, input().split(' ')))
	cor = input()
	print(solve(px, py, cor))


t = int(input())
while t > 0:
	(x, y) = [int(x) for x in input().split()]
	s = input()
	l = list(s)
	a = l.count('R')
	b = l.count('L')
	c = l.count('U')
	d = l.count('D')
	if x >= 0 and x <= a and (y >= 0) and (y <= c):
		print('YES')
	elif x <= 0 and x >= b * -1 and (y >= 0) and (y <= c):
		print('YES')
	elif x <= 0 and x >= b * -1 and (y <= 0) and (y * -1 <= d):
		print('YES')
	elif x >= 0 and x <= a and (y <= 0) and (y * -1 <= d):
		print('YES')
	else:
		print('NO')
	t -= 1


T = input()
T = int(T)
for i in range(T):
	(xt, yt) = input().split()
	xt = int(xt)
	yt = int(yt)
	s = input()
	(x, y) = (0, 0)
	(uc, dc, lc, rc) = (0, 0, 0, 0)
	for i in s:
		if i == 'U':
			y += 1
			uc += 1
		if i == 'D':
			y -= 1
			dc += 1
		if i == 'L':
			x -= 1
			lc += 1
		if i == 'R':
			x += 1
			rc += 1
	xdiff = xt - x
	ydiff = yt - y
	flag = True
	if xdiff < 0 and rc < abs(xdiff):
		flag = False
	if xdiff > 0 and lc < abs(xdiff):
		flag = False
	if ydiff < 0 and uc < abs(ydiff):
		flag = False
	if ydiff > 0 and dc < abs(ydiff):
		flag = False
	if flag:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	u = s.count('U')
	d = -s.count('D')
	r = s.count('R')
	l1 = -s.count('L')
	if l1 <= x <= r and d <= y <= u:
		print('YES')
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
	(x, y) = map(int, input().split())
	S = input()
	(U, D, R, L) = (0, 0, 0, 0)
	for s in S:
		if s == 'U':
			U += 1
		elif s == 'D':
			D += 1
		elif s == 'R':
			R += 1
		else:
			L += 1
	f = 0
	if x == 0 or (x > 0 and R >= x) or (x < 0 and L >= -x):
		if y == 0 or (y > 0 and U >= y) or (y < 0 and D >= -y):
			f = 1
	print('YES' if f else 'NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	minx = -s.count('L')
	maxx = s.count('R')
	miny = -s.count('D')
	maxy = s.count('U')
	if minx <= x <= maxx and miny <= y <= maxy:
		print('YES')
	else:
		print('NO')


for tt in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	a = 0
	b = 0
	if x >= 0:
		if s.count('R') >= x:
			a = 1
	elif s.count('L') >= abs(x):
		a = 1
	if y >= 0:
		if s.count('U') >= y:
			b = 1
	elif s.count('D') >= abs(y):
		b = 1
	if a == 1 and b == 1:
		print('YES')
	else:
		print('NO')


for testis in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	h = 0
	v = 0
	f = 0
	for i in s:
		if i == 'L':
			h = h - 1
		elif i == 'R':
			h = h + 1
		elif i == 'U':
			v = v + 1
		else:
			v = v - 1
	if x - h != 0:
		if x - h > 0:
			if x - h > s.count('L'):
				f = 1
		elif abs(x - h) > s.count('R'):
			f = 1
	if y - v != 0:
		if y - v > 0:
			if y - v > s.count('D'):
				f = 1
		elif abs(y - v) > s.count('U'):
			f = 1
	if f:
		print('NO')
	else:
		print('YES')


try:
	n = input()
	for i in range(int(n)):
		l = list(map(int, input().split()))
		string = input()
		if l[0] >= 0 and l[1] >= 0:
			if string.count('R') >= l[0] and string.count('U') >= l[1]:
				print('YES')
			else:
				print('NO')
		elif l[0] < 0 and l[1] >= 0:
			if string.count('L') >= abs(l[0]) and string.count('U') >= l[1]:
				print('YES')
			else:
				print('NO')
		elif l[0] < 0 and l[1] < 0:
			if string.count('L') >= abs(l[0]) and string.count('D') >= abs(l[1]):
				print('YES')
			else:
				print('NO')
		elif l[0] >= 0 and l[1] < 0:
			if string.count('R') >= l[0] and string.count('D') >= abs(l[1]):
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
except:
	pass


t1 = int(input())
for _ in range(t1):
	(n, m) = map(int, input().split())
	s = str(input())
	o = 0
	if n < 0:
		p = s.count('L')
		if -p > n:
			print('NO')
			o = 1
	else:
		p = s.count('R')
		if p < n:
			print('NO')
			o = 1
	if m < 0:
		p = s.count('D')
		if -p > m and o == 0:
			print('NO')
			o = 1
	else:
		p = s.count('U')
		if p < m and o == 0:
			print('NO')
			o = 1
	if o == 0:
		print('YES')


import sys

def main():
	test_cases = int(sys.stdin.readline())
	for _ in range(test_cases):
		(planet_x, planet_y) = (int(i) for i in sys.stdin.readline().split())
		orders = sys.stdin.readline().strip()
		ctr = {'U': 0, 'D': 0, 'L': 0, 'R': 0}
		for order in orders:
			ctr[order] += 1
		if -ctr['L'] <= planet_x <= ctr['R'] and -ctr['D'] <= planet_y <= ctr['U']:
			print('YES')
		else:
			print('NO')
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
import string
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
ans = []
for _ in range(ii()):
	(px, py) = mi()
	s = input()
	d = collections.Counter(s)
	if 0 < py <= d['U']:
		py = 0
	if 0 < -py <= d['D']:
		py = 0
	if 0 < px <= d['R']:
		px = 0
	if 0 < -px <= d['L']:
		px = 0
	ans.append('YES' if not px and (not py) else 'NO')
print(*ans, sep='\n')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	u = d = l = r = 0
	if y >= 0:
		u = y
	else:
		d = y
	if x >= 0:
		r = x
	else:
		l = x
	if s.count('U') >= u and s.count('D') >= abs(d) and (s.count('L') >= abs(l)) and (s.count('R') >= r):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	s = input()
	r = 0
	l = 0
	u = 0
	d = 0
	if x > 0:
		r += x
	else:
		l += -1 * x
	if y > 0:
		u += y
	else:
		d += -1 * y
	R = s.count('R')
	L = s.count('L')
	U = s.count('U')
	D = s.count('D')
	if R >= r and L >= l and (U >= u) and (D >= d):
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	(a, b) = map(int, input().split())
	s = input()
	u = s.count('U')
	d = s.count('D')
	r = s.count('R')
	l = s.count('L')
	if a >= 0 and b >= 0:
		print('YES' if r >= a and u >= b else 'NO')
	elif a >= 0 and b < 0:
		print('YES' if r >= a and d >= abs(b) else 'NO')
	elif a < 0 and b >= 0:
		print('YES' if l >= abs(a) and u >= b else 'NO')
	else:
		print('YES' if l >= abs(a) and d >= abs(b) else 'NO')


t = int(input())
for z in range(t):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	s = input()
	s = list(s)
	r = s.count('R')
	u = s.count('U')
	l = s.count('L')
	d = s.count('D')
	if x > 0 and y > 0:
		if r >= x and u >= y:
			print('YES')
		else:
			print('NO')
	elif x > 0 and y < 0:
		if r >= x and d >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x < 0 and y > 0:
		if l >= abs(x) and u >= y:
			print('YES')
		else:
			print('NO')
	elif x < 0 and y < 0:
		if l >= abs(x) and d >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x > 0 and y == 0:
		if r >= x:
			print('YES')
		else:
			print('NO')
	elif x < 0 and y == 0:
		if l >= abs(x):
			print('YES')
		else:
			print('NO')
	elif y > 0 and x == 0:
		if u >= y:
			print('YES')
		else:
			print('NO')
	elif y < 0 and x == 0:
		if d >= abs(y):
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	(x1, y1) = map(int, input().split())
	(x, y) = (0, 0)
	s = input()
	cnt_U = s.count('U')
	cnt_D = s.count('D')
	cnt_R = s.count('R')
	cnt_L = s.count('L')
	if x1 >= 0 and y1 >= 0:
		if cnt_R >= x1 and cnt_U >= y1:
			print('YES')
		else:
			print('NO')
	elif x1 >= 0 and y1 <= 0:
		if cnt_R >= x1 and cnt_D >= abs(y1):
			print('YES')
		else:
			print('NO')
	elif x1 <= 0 and y1 >= 0:
		if cnt_L >= abs(x1) and cnt_U >= y1:
			print('YES')
		else:
			print('NO')
	elif cnt_L >= abs(x1) and cnt_D >= abs(y1):
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(0, t):
	(px, py) = map(int, input().split())
	s = input()
	R = s.count('R')
	L = s.count('L')
	D = s.count('D')
	U = s.count('U')
	(rx, ry) = (False, False)
	if px >= 0 and R - px >= 0 or (px < 0 and px + L >= 0):
		rx = True
	if py >= 0 and U - py >= 0 or (py < 0 and py + D >= 0):
		ry = True
	print('YES') if rx and ry else print('NO')


def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))
res = []

def solve(xy, s):
	x = int(xy[0])
	y = int(xy[1])
	if x > 0 and y > 0:
		if s.count('R') >= x and s.count('U') >= y:
			res.append('YES')
		else:
			res.append('NO')
	elif x > 0 and y < 0:
		if s.count('R') >= x and s.count('D') >= abs(y):
			res.append('YES')
		else:
			res.append('NO')
	elif x < 0 and y > 0:
		if s.count('L') >= abs(x) and s.count('U') >= abs(y):
			res.append('YES')
		else:
			res.append('NO')
	elif x < 0 and y < 0:
		if s.count('L') >= abs(x) and s.count('D') >= abs(y):
			res.append('YES')
		else:
			res.append('NO')
	elif x == 0 and y > 0:
		if s.count('U') >= y:
			res.append('YES')
		else:
			res.append('NO')
	elif x == 0 and y < 0:
		if s.count('D') >= abs(y):
			res.append('YES')
		else:
			res.append('NO')
	elif x > 0 and y == 0:
		if s.count('R') >= x:
			res.append('YES')
		else:
			res.append('NO')
	elif x < 0 and y == 0:
		if s.count('L') >= abs(x):
			res.append('YES')
		else:
			res.append('NO')
t = int(input())
for i in range(t):
	coordinates = input_list_int()
	commands = input()
	solve(coordinates, commands)
for i in res:
	print(i)


for i in range(int(input())):
	(p, q) = map(int, input().split())
	s = input()
	cu = s.count('U')
	cd = s.count('D')
	cr = s.count('R')
	cl = s.count('L')
	if (p >= 0 and cr >= abs(p)) and (q >= 0 and cu >= abs(q)):
		print('yes')
	elif (p <= 0 and cl >= abs(p)) and (q >= 0 and cu >= abs(q)):
		print('yes')
	elif (p >= 0 and cr >= abs(p)) and (q <= 0 and cd >= abs(q)):
		print('yes')
	elif (p <= 0 and cl >= abs(p)) and (q <= 0 and cd >= abs(q)):
		print('yes')
	else:
		print('no')


for __ in range(int(input())):
	(px, py) = map(int, input().split())
	s = str(input())
	print('NO') if s.count('U' if py > 0 else 'D') < abs(py) or s.count('R' if px > 0 else 'L') < abs(px) else print('YES')


t = int(input())
for i in range(t):
	n = tuple(map(int, input().split(' ')))
	s = input()
	px = 0
	py = 0
	nx = 0
	ny = 0
	for a in s:
		if a == 'U':
			py += 1
		elif a == 'R':
			px += 1
		elif a == 'L':
			nx += 1
		elif a == 'D':
			ny += 1
	flagx = 0
	flagy = 0
	if n[0] >= 0:
		if px >= n[0]:
			flagx = 1
	elif nx >= -n[0]:
		flagx = 1
	if n[1] >= 0:
		if py >= n[1]:
			flagy = 1
	elif ny >= -n[1]:
		flagy = 1
	if flagx == 1 and flagy == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(x, y) = list(map(int, input().split()))
	(b1, b2) = (False, False)
	s = input()
	ress = [0, 0]
	for i in s:
		if i == 'L':
			ress[0] -= 1
		elif i == 'R':
			ress[0] += 1
		elif i == 'U':
			ress[1] += 1
		else:
			ress[1] -= 1
	if x == ress[0] and y == ress[1]:
		print('YES')
	else:
		if x - ress[0] != 0:
			if x - ress[0] > 0 and s.count('L') >= x - ress[0]:
				b1 = True
			elif x - ress[0] < 0 and s.count('R') >= ress[0] - x:
				b1 = True
			else:
				pass
		else:
			b1 = True
		if y - ress[1] != 0:
			if y - ress[1] > 0 and s.count('D') >= y - ress[1]:
				b2 = True
			elif y - ress[1] < 0 and s.count('U') >= ress[1] - y:
				b2 = True
			else:
				pass
		else:
			b2 = True
		if b1 and b2:
			print('YES')
		else:
			print('NO')


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	(x, y) = [int(x) for x in inp().split()]
	s = inp()
	r = 0
	l = 0
	u = 0
	d = 0
	xOk = False
	yOk = False
	for i in s:
		if i == 'L':
			l += 1
		elif i == 'R':
			r += 1
		elif i == 'U':
			u += 1
		elif i == 'D':
			d += 1
	if x >= 0:
		if r >= x:
			xOk = True
	elif l >= -x:
		xOk = True
	if y >= 0:
		if u >= y:
			yOk = True
	elif d >= -y:
		yOk = True
	if xOk and yOk:
		print('Yes')
	else:
		print('No')


n_sets = int(input())
for _ in range(n_sets):
	(px, py) = map(int, input().split())
	s = input()
	r = [0, 0, 0, 0]
	for x in s:
		if x == 'U':
			r[0] += 1
		elif x == 'D':
			r[1] += 1
		elif x == 'L':
			r[2] += 1
		else:
			r[3] += 1
	if (py <= 0 and r[1] >= -py or (py >= 0 and r[0] >= py)) and (px <= 0 and r[2] >= -px or (px >= 0 and r[3] >= px)):
		print('YES')
	else:
		print('NO')


c = int(input())
for i in range(c):
	(x, y) = [int(_) for _ in input().split(' ')]
	st = input()
	(r, d, l, u) = (0, 0, 0, 0)
	for j in st:
		if j == 'R':
			r = r + 1
		elif j == 'L':
			l = l + 1
		elif j == 'U':
			u = u + 1
		else:
			d = d + 1
	if x > 0 and r >= x:
		x = 0
	if y > 0 and u >= y:
		y = 0
	if x < 0 and l >= -x:
		x = 0
	if y < 0 and d >= -y:
		y = 0
	if x == 0 and y == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = list(map(int, input().split()))
	s = input()
	u = s.count('U')
	d = s.count('D')
	r = s.count('R')
	l = s.count('L')
	u1 = d1 = r1 = l1 = 0
	a = list()
	if x > 0:
		r1 = x
	elif x < 0:
		l1 = abs(x)
	if y > 0:
		u1 = y
	elif y < 0:
		d1 = abs(y)
	if r1 <= r:
		a.append(1)
	else:
		a.append(0)
	if u1 <= u:
		a.append(1)
	else:
		a.append(0)
	if d1 <= d:
		a.append(1)
	else:
		a.append(0)
	if l1 <= l:
		a.append(1)
	else:
		a.append(0)
	if sum(a) == 4:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t -= 1
	(x, y) = map(int, input().split(' '))
	s = input()
	up = 0
	down = 0
	left = 0
	right = 0
	for i in s:
		if i == 'R':
			right += 1
		elif i == 'U':
			up += 1
		elif i == 'D':
			down += 1
		else:
			left += 1
	flag1 = 0
	flag2 = 0
	reqx = 0
	reqy = 0
	if x > 0:
		reqx = x
		if right >= reqx:
			flag1 = 1
	elif x < 0:
		reqx = -x
		if left >= reqx:
			flag1 = 1
	else:
		flag1 = 1
		reqx = 0
	if y > 0:
		reqy = y
		if up >= y:
			flag2 = 1
	elif y < 0:
		reqy = -y
		if down >= reqy:
			flag2 = 1
	else:
		flag2 = 1
		reqy = 0
	if flag1 == 1 and flag2 == 1:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(px, py) = map(int, input().split())
	s = input()
	if px >= 0:
		if s.count('R') < px:
			print('NO')
			continue
	elif s.count('L') < -px:
		print('NO')
		continue
	if py >= 0:
		if s.count('U') < py:
			print('NO')
			continue
	elif s.count('D') < -py:
		print('NO')
		continue
	print('YES')


a = int(input())
for i in range(a):
	(b, c) = map(int, input().split())
	s = input()
	r = 0
	u = 0
	d = 0
	l = 0
	for j in s:
		if j == 'U':
			u += 1
		if j == 'D':
			d -= 1
		if j == 'R':
			r += 1
		if j == 'L':
			l -= 1
	t1 = False
	t2 = False
	if b <= 0 and b >= l or (b >= 0 and b <= r):
		t1 = True
	if c <= 0 and c >= d or (c >= 0 and c <= u):
		t2 = True
	if t1 and t2:
		print('YES')
	else:
		print('NO')


from collections import Counter
for _ in ' ' * int(input()):
	(x, y) = map(int, input().split())
	s = Counter(input())
	cx = False
	cy = False
	if x < 0:
		if s['L'] >= -x:
			cx = True
	elif s['R'] >= x:
		cx = True
	if y < 0:
		if s['D'] >= -y:
			cy = True
	elif s['U'] >= y:
		cy = True
	print('YES' if cx and cy else 'NO')


for _ in range(int(input())):
	p1 = tuple((int(n) for n in input().split(' ')))
	cnt = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	for c in input():
		cnt[c] += 1
	p2 = (cnt['R'] - cnt['L'], cnt['U'] - cnt['D'])
	diff = tuple((p2[i] - p1[i] for i in range(2)))
	possible = abs(diff[0]) <= (cnt['R'] if diff[0] > 0 else cnt['L']) and abs(diff[1]) <= (cnt['U'] if diff[1] > 0 else cnt['D'])
	print('YES' if possible else 'NO')


t = int(input())
for i in range(0, t):
	checkx = 0
	checky = 0
	(x, y) = map(int, input().split())
	s = input()
	if x >= 0:
		countx = s.count('R')
		if countx >= x:
			checkx = 1
	else:
		countx = s.count('L')
		if countx >= abs(x):
			checkx = 1
	if y >= 0:
		county = s.count('U')
		if county >= y:
			checky = 1
	else:
		county = s.count('D')
		if county >= abs(y):
			checky = 1
	if checkx == 1 and checky == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	commands = input()
	r = l = u = d = 0
	OTBET = False
	for i in commands:
		if i == 'R':
			r += 1
		elif i == 'L':
			l -= 1
		elif i == 'U':
			u += 1
		elif i == 'D':
			d -= 1
	if (x >= 0 and r - x >= 0 or (x < 0 and x - l >= 0)) and (y >= 0 and u - y >= 0 or (y < 0 and y - d >= 0)):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(px, py) = map(int, input().split())
	s = input()
	(x, y) = (0, 0)
	res = ''
	di = {'U': 0, 'D': 0, 'L': 0, 'R': 0}
	(u, d, l, r) = (0, 0, 0, 0)
	for i in s:
		di[i] += 1
	(f, f1) = (False, False)
	if px >= x:
		if di['R'] >= px:
			f = True
	elif px < x:
		if di['L'] >= abs(px):
			f = True
	if py >= y:
		if di['U'] >= py:
			f1 = True
	elif di['D'] >= abs(py):
		f1 = True
	if f and f1:
		print('YES')
	else:
		print('NO')


def canMove(s, a, b):
	if a < 0:
		if b < 0:
			if s.count('L') >= -a and s.count('D') >= -b:
				return True
			else:
				return False
		elif s.count('L') >= -a and s.count('U') >= b:
			return True
		else:
			return False
	elif b < 0:
		if s.count('R') >= a and s.count('D') >= -b:
			return True
		else:
			return False
	elif s.count('R') >= a and s.count('U') >= b:
		return True
	else:
		return False
t = int(input())
for i in range(t):
	(a, b) = [int(x) for x in input().split()]
	s = input()
	if canMove(s, a, b):
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(x, y) = map(int, input().split())
	s = input()
	cnt = [0, 0, 0, 0]
	for i in range(0, len(s), 1):
		if s[i] == 'U':
			cnt[0] += 1
		elif s[i] == 'D':
			cnt[1] += 1
		elif s[i] == 'R':
			cnt[2] += 1
		else:
			cnt[3] += 1
	ok = True
	if x > 0:
		if cnt[2] < x:
			ok = False
	elif x < 0:
		if cnt[3] < -1 * x:
			ok = False
	if y > 0:
		if cnt[0] < y:
			ok = False
	elif y < 0:
		if cnt[1] < -1 * y:
			ok = False
	if ok:
		print('YES')
	else:
		print('NO')
	t = t - 1


for _ in range(int(input())):
	flag = True
	(x, y) = map(int, input().split())
	a = input()
	r = a.count('R')
	l = -a.count('L')
	u = a.count('U')
	d = -a.count('D')
	if x < 0 and (not l <= x):
		flag = False
	if x >= 0 and (not x <= r):
		flag = False
	if y < 0 and (not d <= y):
		flag = False
	if y >= 0 and (not y <= u):
		flag = False
	print('YES' if flag else 'NO')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	s = list(input())
	e = 0
	if a > 0:
		if s.count('R') >= a:
			e += 1
	elif a == 0:
		e += 1
	elif s.count('L') >= -a:
		e += 1
	if b > 0:
		if s.count('U') >= b:
			e += 1
	elif b == 0:
		e += 1
	elif s.count('D') >= -b:
		e += 1
	if e == 2:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(px, py) = map(int, input().split())
	s = list(map(str, input()))
	c = 0
	if px >= 1 and s.count('R') >= px:
		c = c + 1
	elif px < 0 and s.count('L') >= abs(px):
		c = c + 1
	if py >= 1 and s.count('U') >= py:
		c = c + 1
	elif py < 0 and s.count('D') >= abs(py):
		c = c + 1
	if px == 0:
		c = c + 1
	if py == 0:
		c = c + 1
	if c == 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(x, y) = map(int, input().split())
	s = input()
	(mnx, mxx, mny, mxy) = (0, 0, 0, 0)
	for c in s:
		if c == 'U':
			mxy += 1
		elif c == 'D':
			mny -= 1
		elif c == 'L':
			mnx -= 1
		elif c == 'R':
			mxx += 1
	if mnx <= x <= mxx and mny <= y <= mxy:
		print('YES')
	else:
		print('NO')


for g in range(int(input())):
	arr = list(map(int, input().split()))
	n = arr[0]
	k = arr[1]
	s = input()
	(r, l, u, d) = (0, 0, 0, 0)
	for i in range(len(s)):
		if s[i] == 'R':
			r += 1
		elif s[i] == 'U':
			u += 1
		elif s[i] == 'L':
			l += 1
		else:
			d += 1
	flag = 0
	if n > 0 and n > r:
		flag = 1
	elif n < 0 and abs(n) > abs(l):
		flag = 1
	elif k > 0 and k > u:
		flag = 1
	elif k < 0 and abs(k) > abs(d):
		flag = 1
	if flag == 1:
		print('NO')
	else:
		print('YES')


from __future__ import division, print_function
import time
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def string2intlist(s):
	return list(map(int, s))

def calculate_sum(a, N):
	m = N / a
	sum = m * (m + 1) / 2
	ans = a * sum
	return ans

def series(N):
	return N * (N + 1) // 2

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def nCr(n, r):
	i = 1
	while i < r:
		n *= n - i
		i += 1
	return n // math.factorial(r)

def LCM(x, y):
	return x * y // math.gcd(x, y)

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def isprime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, int(math.sqrt(n)) + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def knapSack(W, wt, val, n):
	K = [[0 for x in range(W + 1)] for x in range(n + 1)]
	for i in range(n + 1):
		for w in range(W + 1):
			if i == 0 or w == 0:
				K[i][w] = 0
			elif wt[i - 1] <= w:
				K[i][w] = max(val[i - 1] + K[i - 1][w - wt[i - 1]], K[i - 1][w])
			else:
				K[i][w] = K[i - 1][w]
	return K[n][W]

def modularExponentiation(x, n):
	M = 10 ** 9 + 7
	if n == 0:
		return 1
	elif n % 2 == 0:
		return modularExponentiation(x * x % M, n // 2)
	else:
		return x * modularExponentiation(x * x % M, (n - 1) // 2) % M

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
for _ in range(inin()):
	(x, y) = spin()
	a = stin()
	flag = 'NO'
	if x >= 0 and y >= 0:
		if a.count('R') >= x and a.count('U') >= y:
			flag = 'YES'
	elif x >= 0 and y < 0:
		if a.count('R') >= x and a.count('D') >= -y:
			flag = 'YES'
	elif x < 0 and y >= 0:
		if a.count('L') >= -x and a.count('U') >= y:
			flag = 'YES'
	elif x < 0 and y < 0:
		if a.count('L') >= -x and a.count('D') >= -y:
			flag = 'YES'
	print(flag)


import math
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
t = int(input())
for _ in range(t):
	(px, py) = map(int, input().split())
	s = input()
	(U, D, R, L) = (0, 0, 0, 0)
	MOVES = {'U': U, 'D': D, 'R': R, 'L': L}
	if px >= 0:
		MOVES['R'] = px
	else:
		MOVES['L'] = abs(px)
	if py >= 0:
		MOVES['U'] = py
	else:
		MOVES['D'] = abs(py)
	flag = True
	for key in MOVES:
		if s.count(key) < MOVES[key]:
			flag = False
			break
	print('YES' if flag else 'NO')


tcs = int(input())
for i in range(tcs):
	destination = [int(x) for x in input().split()]
	instructions = input()
	if destination[1] > 0:
		if instructions.count('U') < destination[1]:
			print('NO')
			continue
	elif instructions.count('D') < abs(destination[1]):
		print('NO')
		continue
	if destination[0] > 0:
		if instructions.count('R') < destination[0]:
			print('NO')
			continue
	elif instructions.count('L') < abs(destination[0]):
		print('NO')
		continue
	print('YES')


def process():
	(px, py) = list(map(int, input().split()))
	x = 'R' if px >= 0 else 'L'
	y = 'U' if py >= 0 else 'D'
	s = input()
	c1 = s.count(x) >= abs(px)
	c2 = s.count(y) >= abs(py)
	return c1 and c2
for _ in range(int(input())):
	res = process()
	print('YES' if res else 'NO')


t = int(input(''))
for _ in range(t):
	(x, y) = map(int, input().split())
	s = input('')
	if x > 0:
		if s.count('R') >= x:
			X = True
		else:
			X = False
	elif s.count('L') >= abs(x):
		X = True
	else:
		X = False
	if y > 0:
		if s.count('U') >= y:
			Y = True
		else:
			Y = False
	elif s.count('D') >= abs(y):
		Y = True
	else:
		Y = False
	if X and Y:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	s = input()
	(U, D, R, L) = (s.count('U'), -s.count('D'), s.count('R'), -s.count('L'))
	if a <= 0 and b <= 0:
		if a >= L and b >= D:
			print('YES')
		else:
			print('NO')
	elif a >= 0 and b >= 0:
		if a <= R and b <= U:
			print('YES')
		else:
			print('NO')
	elif a <= 0 and b >= 0:
		if a >= L and b <= U:
			print('YES')
		else:
			print('NO')
	elif a <= R and b >= D:
		print('YES')
	else:
		print('NO')
	R = D = L = U = a = 0


def solution():
	if p >= 0 and q >= 0:
		if s.count('R') >= p and s.count('U') >= q:
			print('YES')
		else:
			print('NO')
	elif p >= 0 and q <= 0:
		if s.count('R') >= p and s.count('D') >= abs(q):
			print('YES')
		else:
			print('NO')
	elif p <= 0 and q >= 0:
		if s.count('L') >= abs(p) and s.count('U') >= q:
			print('YES')
		else:
			print('NO')
	elif s.count('L') >= abs(p) and s.count('D') >= abs(q):
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	s = input()
	solution()


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	string = input()
	mx = string.count('R') if x > 0 else string.count('L')
	my = string.count('U') if y > 0 else string.count('D')
	if abs(x) <= mx and abs(y) <= my:
		print('YES')
	else:
		print('NO')


import math, sys, itertools
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in [wtf[i:i + 2] for i in range(1, len(wtf), 2)]:
	(px, py) = map(int, t[0].split())
	S = t[1]
	pxs = ' '
	pys = ' '
	if px > 0:
		pxs = px * 'R'
	elif px < 0:
		pxs = -px * 'L'
	if py > 0:
		pys = py * 'U'
	elif py < 0:
		pys = -py * 'D'
	pysc = S.count(pys[0])
	pxsc = S.count(pxs[0])
	print('YES' if pysc >= abs(py) and pxsc >= abs(px) else 'NO')


for w in range(int(input())):
	(x1, y1) = map(int, input().split())
	s = input()
	u = s.count('U')
	d = s.count('D')
	r = s.count('R')
	l = s.count('L')
	if x1 > 0 and r < x1 or (x1 < 0 and l < abs(x1)):
		print('NO')
	elif y1 > 0 and u < y1 or (y1 < 0 and d < abs(y1)):
		print('NO')
	else:
		print('YES')


t = int(input())
for j in range(t):
	(px, py) = map(int, input().split())
	s = input()
	R_count = s.count('R')
	U_count = s.count('U')
	D_count = s.count('D')
	L_count = s.count('L')
	flag = 0
	if px >= 0 and py >= 0:
		if U_count >= py and R_count >= px:
			flag = 1
	elif px < 0 and py >= 0:
		if U_count >= py and L_count >= abs(px):
			flag = 1
	elif px < 0 and py < 0:
		if L_count >= abs(px) and D_count >= abs(py):
			flag = 1
	elif px >= 0 and py < 0:
		if R_count >= px and D_count >= abs(py):
			flag = 1
	if flag == 0:
		print('NO')
	else:
		print('YES')


from sys import stdin
from math import gcd
input = lambda : stdin.readline().strip()
ipnut = input
yes = 'YES'
no = 'NO'
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = list(input())
	u = s.count('U')
	d = s.count('D')
	l = s.count('L')
	r = s.count('R')
	if y >= 0 and x >= 0:
		if u >= y and r >= x:
			print(yes)
		else:
			print(no)
	elif y >= 0 and x <= 0:
		if u >= y and -x <= l:
			print(yes)
		else:
			print(no)
	elif y <= 0 and x >= 0:
		if d >= -y and r >= x:
			print(yes)
		else:
			print(no)
	elif y <= 0 and x <= 0:
		if d >= -y and l >= -x:
			print(yes)
		else:
			print(no)


t = int(input())
for _ in range(t):
	(r, u) = [int(i) for i in input().split()]
	(l, d) = (0, 0)
	if r < 0:
		l = -r
		r = 0
	if u < 0:
		d = -u
		u = 0
	x = input()
	r1 = 0
	u1 = 0
	l1 = 0
	d1 = 0
	for i in x:
		if i == 'R':
			r1 += 1
		elif i == 'U':
			u1 += 1
		elif i == 'L':
			l1 += 1
		else:
			d1 += 1
	if r1 >= r and u1 >= u and (d1 >= d) and (l1 >= l):
		print('YES')
	else:
		print('NO')


def func():
	t = int(input())
	for _ in range(t):
		(x, y) = map(int, input().strip().split())
		orders = input().strip()
		(u, d, r, l) = (orders.count('U'), orders.count('D'), orders.count('R'), orders.count('L'))
		if -l <= x <= r and -d <= y <= u:
			print('YES')
		else:
			print('NO')
func()


t = int(input())
for _ in range(t):
	(px, py) = map(int, input().split())
	s = input()
	R = s.count('R')
	U = s.count('U')
	L = s.count('L')
	D = s.count('D')
	if px < 0:
		if L < abs(px):
			print('NO')
			continue
	if px > 0:
		if R < px:
			print('NO')
			continue
	if py < 0:
		if D < abs(py):
			print('NO')
			continue
	if py > 0:
		if U < py:
			print('NO')
			continue
	print('YES')


import math

def solve():
	(px, py) = input().split()
	px = int(px)
	py = int(py)
	s = input()
	v = 0
	h = 0
	a1 = False
	a2 = False
	if py > 0:
		v = s.count('U')
		if v >= py:
			a1 = True
	elif py < 0:
		v = s.count('D')
		if v >= abs(py):
			a1 = True
	else:
		a1 = True
	if px > 0:
		v = s.count('R')
		if v >= px:
			a2 = True
	elif px < 0:
		v = s.count('L')
		if v >= abs(px):
			a2 = True
	else:
		a2 = True
	if a1 and a2:
		print('YES')
	else:
		print('NO')
T = int(input())
for i in range(T):
	solve()


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = list(input())
	p = 0
	q = 0
	if x > 0 and y > 0:
		for i in s:
			if i == 'R':
				p += 1
			elif i == 'U':
				q += 1
		if p >= x and q >= y:
			print('YES')
		else:
			print('NO')
	elif x < 0 and y > 0:
		for i in s:
			if i == 'L':
				p += 1
			elif i == 'U':
				q += 1
		if p >= abs(x) and q >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x > 0 and y < 0:
		for i in s:
			if i == 'R':
				p += 1
			elif i == 'D':
				q += 1
		if p >= abs(x) and q >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x < 0 and y < 0:
		for i in s:
			if i == 'L':
				p += 1
			elif i == 'D':
				q += 1
		if p >= abs(x) and q >= abs(y):
			print('YES')
		else:
			print('NO')
	elif x == 0:
		for i in s:
			if y > 0 and i == 'U' or (y < 0 and i == 'D'):
				q += 1
		if q >= abs(y):
			print('YES')
		else:
			print('NO')
	elif y == 0:
		for i in s:
			if x > 0 and i == 'R' or (x < 0 and i == 'L'):
				p += 1
		if p >= abs(x):
			print('YES')
		else:
			print('NO')


t = int(input())
while t > 0:
	(x, y) = map(int, input().split())
	s = str(input())
	R = s.count('R')
	L = s.count('L')
	U = s.count('U')
	D = s.count('D')
	if (x > 0 and y == 0) and R >= abs(x):
		print('YES')
	elif (x < 0 and y == 0) and L >= abs(x):
		print('YES')
	elif (y > 0 and x == 0) and U >= abs(y):
		print('YES')
	elif (y < 0 and x == 0) and D >= abs(y):
		print('YES')
	elif (x < 0 and y > 0) and (L >= abs(x) and U >= abs(y)):
		print('YES')
	elif (x > 0 and y > 0) and (R >= abs(x) and U >= abs(y)):
		print('YES')
	elif (x < 0 and y < 0) and (L >= abs(x) and D >= abs(y)):
		print('YES')
	elif (x > 0 and y < 0) and R >= abs(x) and (D >= abs(y)):
		print('YES')
	else:
		print('NO')
	t = t - 1


t = int(input())
while t:
	t -= 1
	(x, y) = map(int, input().split())
	s = input()
	flag = 0
	if x > 0:
		if s.count('R') >= x:
			pass
		else:
			flag = 1
	elif s.count('L') >= x * -1:
		pass
	else:
		flag = 1
	if y > 0:
		if s.count('U') >= y:
			pass
		else:
			flag = 1
	elif s.count('D') >= y * -1:
		pass
	else:
		flag = 1
	if flag:
		print('NO')
	else:
		print('YES')


tests = int(input())
for _ in range(tests):
	(px, py) = map(int, input().split())
	s = input().strip()
	(x, y) = (0, 0)
	right = s.count('R')
	left = s.count('L')
	up = s.count('U')
	down = s.count('D')
	result = True
	if px > 0:
		result = result and right >= px
	elif px < 0:
		result = result and left >= abs(px)
	if py > 0:
		result = result and up >= py
	elif py < 0:
		result = result and down >= abs(py)
	print('YES' if result else 'NO')


def helper(p1, p2, s):
	if p1 > 0:
		if s.count('R') < p1:
			return 0
	elif p1 < 0:
		if s.count('L') < p1 * -1:
			return 0
	if p2 > 0:
		if s.count('U') < p2:
			return 0
	elif p2 < 0:
		if s.count('D') < p2 * -1:
			return 0
	return 1
for i in range(int(input())):
	(p1, p2) = map(int, input().split())
	s = input()
	if helper(p1, p2, s):
		print('Yes')
	else:
		print('No')


T = int(input())
for testcase in range(1, T + 1):
	(x, y) = [int(s) for s in input().split(' ')]
	s = input()
	r = l = u = d = 0
	for c in s:
		if c == 'R':
			r += 1
		elif c == 'L':
			l += 1
		elif c == 'U':
			u += 1
		elif c == 'D':
			d += 1
		else:
			print('error')
	possible = True
	if x > 0 and x > r:
		possible = False
	if x < 0 and -x > l:
		possible = False
	if y > 0 and y > u:
		possible = False
	if y < 0 and -y > d:
		possible = False
	if possible:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = [int(_) for _ in input().split()]
	s = input()
	xx = yy = False
	if x == 0 or (x < 0 and s.count('L') >= abs(x)) or (x > 0 and s.count('R') >= x):
		xx = True
	if y == 0 or (y < 0 and s.count('D') >= abs(y)) or (y > 0 and s.count('U') >= y):
		yy = True
	print(['NO', 'YES'][xx and yy])


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	l = list(input())
	up = l.count('U')
	down = l.count('D')
	left = l.count('L')
	right = l.count('R')
	xp = right - left
	yp = up - down
	ans1 = False
	ans2 = False
	if yp > y and yp - y <= up:
		ans1 = True
	elif yp < y and y - yp <= down:
		ans1 = True
	if xp > x and xp - x <= right:
		ans2 = True
	elif xp < x and x - xp <= left:
		ans2 = True
	if yp == y:
		ans1 = True
	if xp == x:
		ans2 = True
	if ans1 and ans2:
		print('yes')
	else:
		print('NO')


for i in range(int(input())):
	(x, y) = input().split()
	s = input()
	x = int(x)
	y = int(y)
	flag = True
	if x < 0 and s.count('L') < abs(x):
		flag = False
	elif x > 0 and s.count('R') < x:
		flag = False
	if y < 0 and s.count('D') < abs(y):
		flag = False
	elif y > 0 and s.count('U') < y:
		flag = False
	print('YES' if flag else 'NO')


for _ in range(int(input())):
	(p1, p2) = [int(i) for i in input().split(' ')]
	str = input()
	(u, d, r, l) = (0, 0, 0, 0)
	for s in str:
		if s == 'R':
			r += 1
		elif s == 'U':
			u += 1
		elif s == 'D':
			d -= 1
		elif s == 'L':
			l -= 1
	t1 = d <= p2 <= u
	t2 = r >= p1 >= l
	if t1 and t2:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	(px, py) = [int(x) for x in input().split()]
	s = input()
	l = r = u = d = 0
	for i in s:
		if i == 'R':
			r += 1
		if i == 'L':
			l -= 1
		if i == 'U':
			u += 1
		if i == 'D':
			d -= 1
	print('YES' if l <= px <= r and d <= py <= u else 'NO')


for _ in range(int(input())):
	(x, y) = list(map(int, input().split(' ')))
	(s, sol) = (input(), 'YES')
	if x >= 0:
		if x > s.count('R'):
			sol = 'NO'
	elif x < 0:
		if abs(x) > s.count('L'):
			sol = 'NO'
	if y >= 0:
		if y > s.count('U'):
			sol = 'NO'
	elif y < 0:
		if abs(y) > s.count('D'):
			sol = 'NO'
	print(sol)


n = int(input())
for _ in range(n):
	a = [int(u) for u in input().split()]
	b = input()
	i = b.count('R')
	j = b.count('L')
	k = b.count('U')
	l = b.count('D')
	if a[0] >= 0:
		if a[1] >= 0:
			if i >= a[0] and k >= a[1]:
				print('YES')
			else:
				print('NO')
		elif i >= a[0] and l >= abs(a[1]):
			print('YES')
		else:
			print('NO')
	elif a[1] >= 0:
		if j >= abs(a[0]) and k >= a[1]:
			print('YES')
		else:
			print('NO')
	elif j >= abs(a[0]) and l >= abs(a[1]):
		print('YES')
	else:
		print('NO')


case = int(input())
for i in range(case):
	stepDict = {'R': 0, 'L': 0, 'U': 0, 'D': 0}
	(pos_x, pos_y) = map(int, input().split(' '))
	for s in list(input()):
		stepDict[s] = stepDict.get(s) + 1
	if pos_x > 0:
		if stepDict['R'] < pos_x:
			print('NO')
			continue
	elif stepDict['L'] < -pos_x:
		print('NO')
		continue
	if pos_y > 0:
		if stepDict['U'] < pos_y:
			print('NO')
			continue
	elif stepDict['D'] < -pos_y:
		print('NO')
		continue
	print('YES')


t = int(input())
while t:
	(m, n) = map(int, input().split())
	string = list(input())
	cnt = 0
	if m - 0 < 0:
		cnt = string.count('L')
	else:
		cnt = string.count('R')
	cnt1 = 0
	if n - 0 < 0:
		cnt1 = string.count('D')
	else:
		cnt1 = string.count('U')
	if cnt >= abs(m) and cnt1 >= abs(n):
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	s = input()
	(l, r, u, d, f, ss) = (0, 0, 0, 0, 0, 0)
	for _ in range(len(s)):
		if s[_] == 'U':
			u += 1
		elif s[_] == 'D':
			d -= 1
		elif s[_] == 'R':
			r += 1
		else:
			l -= 1
	if x < 0 and l <= x:
		f = 1
	if x >= 0 and r >= x:
		f = 1
	if y < 0 and d <= y:
		ss = 1
	if y >= 0 and u >= y:
		ss = 1
	if ss == 1 and f == 1:
		print('YES')
	else:
		print('NO')


times = int(input().strip())
for t in range(times):
	suffX = False
	suffY = False
	coor = input().split()
	(x, y) = (int(coor[0]), int(coor[1]))
	s = input().strip()
	if x >= 0:
		if s.count('R') >= x:
			suffX = True
	elif s.count('L') >= abs(x):
		suffX = True
	if y >= 0:
		if s.count('U') >= y:
			suffY = True
	elif s.count('D') >= abs(y):
		suffY = True
	if suffX and suffY:
		print('YES')
	else:
		print('NO')


def resolve(x, y, command):
	h = {'R': 0, 'L': 0, 'U': 0, 'D': 0}
	for letter in command:
		h[f'{letter}'] += 1
	if x >= 0:
		comp_x = h['R'] >= x
	else:
		comp_x = h['L'] >= abs(x)
	if y >= 0:
		comp_y = h['U'] >= y
	else:
		comp_y = h['D'] >= abs(y)
	return comp_x and comp_y
N = int(input())
while N:
	coord = input().split()
	x = int(coord[0])
	y = int(coord[1])
	command = list(input())
	print('YES' if resolve(x, y, command) else 'NO')
	N -= 1


def chk(x, y, d):
	g = 0
	if y < 0:
		if d['D'] >= -y:
			g += 1
		else:
			return print('NO')
	elif y > 0:
		if d['U'] >= y:
			g += 1
		else:
			return print('NO')
	if x < 0:
		if d['L'] >= -x:
			g += 1
		else:
			return print('NO')
	elif x > 0:
		if d['R'] >= x:
			g += 1
		else:
			return print('NO')
	return print('YES')
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = input()
	(x0, y0) = (0, 0)
	d = {'U': 0, 'D': 0, 'R': 0, 'L': 0}
	for i in s:
		d[i] += 1
	chk(x, y, d)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	string = input()
	(positiveX, positiveY, negativeX, negativeY) = (0, 0, 0, 0)
	for i in string:
		if i == 'R':
			positiveX += 1
		elif i == 'L':
			negativeX -= 1
		elif i == 'U':
			positiveY += 1
		else:
			negativeY -= 1
	if negativeX <= x <= positiveX and negativeY <= y <= positiveY:
		print('YES')
	else:
		print('NO')


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())
for i in range(int(input())):
	(Px, Py) = get_ints()
	(in1, in2, in3, in4) = (0, 0, 0, 0)
	s = input().strip()
	test = ''
	for j in s:
		if j == 'U':
			in1 += 1
		if j == 'D':
			in2 -= 1
		if j == 'R':
			in3 += 1
		if j == 'L':
			in4 -= 1
		if in1 == Py:
			test += '1'
		if in2 == Py:
			test += '1'
		if in3 == Px:
			test += '2'
		if in4 == Px:
			test += '2'
	if '1' in test and '2' in test:
		print('YES')
	else:
		print('NO')


from collections import Counter

def solve(s, x, y):
	flagx = flagy = False
	if x > 0:
		qtd = abs(x)
		dicionario_x = Counter(s)
		flagx = dicionario_x['R'] >= qtd
	elif x < 0:
		qtd = abs(x)
		dicionario_x = Counter(s)
		flagx = dicionario_x['L'] >= qtd
	else:
		flagx = True
	if y > 0:
		qtd = abs(y)
		dicionario_x = Counter(s)
		flagy = dicionario_x['U'] >= qtd
	elif y < 0:
		qtd = abs(y)
		dicionario_x = Counter(s)
		flagy = dicionario_x['D'] >= qtd
	else:
		flagy = True
	if flagx and flagy:
		print('YES')
	else:
		print('NO')
N = int(input())
for i in range(N):
	(x, y) = map(int, input().split())
	s = input()
	solve(s, x, y)


for _ in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	s = input()
	(u, d, r, l) = map(s.count, 'UDRL')
	if -d <= b <= u and -l <= a <= r:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	s = input()
	c = 0
	if a >= 0:
		if s.count('R') >= a:
			c += 1
	if a < 0:
		if s.count('L') >= abs(a):
			c += 1
	if b >= 0:
		if s.count('U') >= b:
			c += 1
	if b < 0:
		if s.count('D') >= abs(b):
			c += 1
	if c == 2:
		print('YES')
	else:
		print('NO')


def solution():
	(px, py) = [int(i) for i in input().split()]
	s = input()
	minx = -s.count('L')
	miny = -s.count('D')
	maxx = s.count('R')
	maxy = s.count('U')
	if minx <= px <= maxx and miny <= py <= maxy:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solution()


import sys
mod = int(1000000000.0) + 7

def sinp():
	return sys.stdin.readline().strip()

def zinp():
	return int(input())

def zzinp():
	return map(int, sys.stdin.readline().strip().split())

def llinp():
	return list(map(int, sys.stdin.readline().strip().split()))

def pr(a, b):
	print(a, b)
for i in range(zinp()):
	(p, q) = zzinp()
	s = sinp()
	a = s.count('L')
	b = s.count('R')
	c = s.count('U')
	d = s.count('D')
	m = 0
	n = 0
	if p >= 0:
		if b >= p:
			m += 1
	if p < 0:
		if a >= abs(p):
			m = m + 1
	if q >= 0:
		if c >= q:
			n += 1
	if q < 0:
		if d >= abs(q):
			n = n + 1
	if m > 0 and n > 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	d = {'R': 0, 'L': 0, 'U': 0, 'D': 0}
	(x, y) = list(map(int, input().split()))
	s = input()
	for ch in s:
		d[ch] += 1
	x1 = d['R'] - d['L']
	y1 = d['U'] - d['D']
	if (x1 >= x and d['R'] >= abs(x1 - x) or (x1 < x and d['L'] >= abs(x1 - x))) and (y1 >= y and d['U'] >= abs(y1 - y) or (y1 < y and d['D'] >= abs(y1 - y))):
		print('YES')
	else:
		print('NO')


import sys
for _ in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	s = input()
	f = True
	if x < 0:
		if -x > s.count('L'):
			f = False
	if y < 0:
		if -y > s.count('D'):
			f = False
	if x > 0:
		if x > s.count('R'):
			f = False
	if y > 0:
		if y > s.count('U'):
			f = False
	if f:
		print('YES')
	else:
		print('NO')


import math
ans = []
t = int(input())

def doWork(input):
	((x, y), s) = input
	U = s.count('U') + 1
	D = s.count('D') * -1
	R = s.count('R') + 1
	L = s.count('L') * -1
	if y in range(D, U) and x in range(L, R):
		return 'YES'
	else:
		return 'NO'
for _ in range(t):
	(x, y) = [int(x) for x in input().split()]
	s = input()
	ans.append(doWork(((x, y), s)))
for ele in ans:
	print(ele)


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	s = input()
	f = False
	g = False
	if a > 0:
		if s.count('R') >= a:
			f = True
	elif s.count('L') >= -a:
		f = True
	if b > 0:
		if s.count('U') >= b:
			g = True
	elif s.count('D') >= -b:
		g = True
	if f and g:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(m, n) = map(int, input().split())
	s = input()
	f = f1 = False
	if m >= 0:
		if s.count('R') >= m:
			f = True
	elif s.count('L') >= -m:
		f = True
	if n >= 0:
		if s.count('U') >= n:
			f1 = True
	elif s.count('D') >= -n:
		f1 = True
	print('YES') if f and f1 else print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	z = input()
	countR = z.count('R')
	countL = z.count('L')
	countU = z.count('U')
	countD = z.count('D')
	if x > 0:
		if y > 0:
			if countR >= x and countU >= y:
				print('YES')
			else:
				print('NO')
		elif countR >= x and countD >= abs(y):
			print('YES')
		else:
			print('NO')
	elif y > 0:
		if countL >= abs(x) and countU >= y:
			print('YES')
		else:
			print('NO')
	elif countL >= abs(x) and countD >= abs(y):
		print('YES')
	else:
		print('NO')


w = int(input())
for i in range(w):
	(x, y) = list(map(int, input().split()))
	l = input()
	U = l.count('U')
	D = l.count('D') * -1
	L = l.count('L') * -1
	R = l.count('R')
	if y <= U and y >= D and (x >= L) and (x <= R):
		print('YES')
	else:
		print('NO')


def A(x, y, s):
	d = {'U': s.count('U'), 'D': s.count('D'), 'R': s.count('R'), 'L': s.count('L')}
	if y < 0:
		y1 = d['D']
	else:
		y1 = d['U']
	if x < 0:
		x1 = d['L']
	else:
		x1 = d['R']
	return (x1, y1)
t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	s = input()
	(a, b) = A(x, y, s)
	if a >= abs(x) and b >= abs(y):
		print('YES')
	else:
		print('NO')