Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string s. Each character of s is one move operation. There are four move operations at all:  'U': go up, (x, y)  →  (x, y+1);  'D': go down, (x, y)  →  (x, y-1);  'L': go left, (x, y)  →  (x-1, y);  'R': go right, (x, y)  →  (x+1, y). 

The robot will do the operations in s from left to right, and repeat it infinite times. Help Fox Ciel to determine if after some steps the robot will located in (a, b).


-----Input-----

The first line contains two integers a and b, ( - 10^9 ≤ a, b ≤ 10^9). The second line contains a string s (1 ≤ |s| ≤ 100, s only contains characters 'U', 'D', 'L', 'R') — the command.


-----Output-----

Print "Yes" if the robot will be located at (a, b), and "No" otherwise.


-----Examples-----
Input
2 2
RU

Output
Yes

Input
1 2
RU

Output
No

Input
-1 1000000000
LRRLU

Output
Yes

Input
0 0
D

Output
Yes



-----Note-----

In the first and second test case, command string is "RU", so the robot will go right, then go up, then right, and then up and so on.

The locations of its moves are (0, 0)  →  (1, 0)  →  (1, 1)  →  (2, 1)  →  (2, 2)  →  ...

So it can reach (2, 2) but not (1, 2).

Difficulty: competition

Starter code:

Solutions:
a, b = list(map(int, input().split()))
s = input()
sm = [[0, 0] for i in range(len(s))]
repl = {'U': (0, 1), 'D': (0, -1), 'L': (-1, 0), 'R': (1, 0)}
for i, c in enumerate(s):
    sm[i][0] = sm[i - 1][0] + repl[c][0]
    sm[i][1] = sm[i - 1][1] + repl[c][1]
# a = n * sm[-1][0] + sm[i][0]
for i in range(len(s)):
    na, nb = 0 if sm[-1][0] == 0 else (a - sm[i][0]) // sm[-1][0], 0 if sm[-1][1] == 0 else (b - sm[i][1]) // sm[-1][1]
    if a == na * sm[-1][0] + sm[i][0] and b == nb * sm[-1][1] + sm[i][1] and (0 in sm[-1] or na == nb) and na >= -1 and nb >= -1:
        print('Yes')
        return
print('No')


a,b=input().split()

a=int(a)
b=int(b)

s=input()
n=len(s)
L=[]

x=0
y=0
hor=s.count('R')-s.count('L')
ver=s.count('U')-s.count('D')
L=[[0,0]]
for i in range(n):
    if(s[i]=='U'):
        y+=1
    elif(s[i]=='D'):
        y-=1
    elif(s[i]=='R'):
        x+=1
    else:
        x-=1
    L.append([x,y])
k=True
for i in range(n+1):
    x=L[i][0]
    y=L[i][1]
    if(hor==0 and ver==0 and x==a and b==y):
        print('Yes')
        k=False
        break
    elif(hor==0 and ver!=0 and x==a and (b-y)%ver==0 and (b-y)*ver>=0):
        print('Yes')
        k=False
        break
    elif(ver==0 and hor!=0 and y==b and (a-x)%hor==0 and (a-x)*hor>=0):
        print('Yes')
        k=False
        break
    elif(ver!=0 and hor!=0 and(b-y)%ver==0 and ver*(b-y)>=0 and (a-x)%hor==0 and hor*(a-x)>=0 and(b-y)//ver==(a-x)//hor):
        print('Yes')
        k=False
        break

if(k):
    print('No')

        


def minus_two(x, y):
    return [x[0] - y[0], x[1] - y[1]]

def will_reach(loc, commands):
    new_loc = [0, 0]
    possible_locs = [[0, 0]]
    for c in commands:
        if c == "U":
            new_loc[1] += 1
        elif c == "D":
            new_loc[1] -= 1
        elif c == "R":
            new_loc[0] += 1
        elif c == "L":
            new_loc[0] -= 1
        possible_locs += [list(new_loc)]

        
    all_destinations = [minus_two(loc, pl) for pl in possible_locs]


    for destination in all_destinations :
##        print("destination", destination)
##        print("slope", new_loc)
        realdx = destination[0]
        realdy = destination[1]

        reqdx = new_loc[0]
        reqdy = new_loc[1]

        if destination == [0, 0]:
            return True

        if reqdx != 0 and realdx != 0:
            if ((realdy / realdx) == (reqdy / reqdx) \
            and (((realdy > 0 and reqdy > 0)) or((realdy < 0 and reqdy < 0)))     \
            and (realdy / reqdy) == int(realdy / reqdy)    \
            and (realdx / reqdx) == int(realdx / reqdx)): 
                return True
        if  realdy == reqdy and realdx == reqdx:
            return True
        if reqdx == 0 and realdx == 0:
            if ((reqdy > 0 and realdy > 0) or (reqdy < 0 and realdy < 0)) \
            and (realdy / reqdy) == int(realdy / reqdy):
                return True
        if reqdy == 0 and realdy == 0:

            if ((reqdx > 0 and realdx > 0) or (reqdx < 0 and realdx < 0)) \
            and (realdx / reqdx) == int(realdx / reqdx):
                return True
    return False

    
def will_reach2(loc, commands):
    new_loc = [0, 0]
    available_loc = []
    for c in commands:
        if c == "U":
            new_loc[1] += 1
        elif c == "D":
            new_loc[1] -= 1
        elif c == "R":
            new_loc[0] += 1
        elif c == "L":
            new_loc[0] -= 1
        available_loc += [new_loc]
    

    realdx = new_loc[0]
    realdy = new_loc[1]

    reqdx = loc[0]
    reqdy = loc[1]

    print("realdx", realdx)
    print("realdy", realdy)
    print("reqdx", reqdx)
    print("reqdy", reqdy)
    

    if reqdx != 0 and realdx != 0:
        return (realdy / realdx) == (reqdy / reqdx)
    elif reqdx == 0 and realdx == 0:
            return reqdy / realdy > 0
    else:
        return False    


def main():
    first_line = input()
    first_line = first_line.split()
    
    loc = [int(first_line[0]), int(first_line[1])]

    cmds = input()
   

    if (will_reach(loc, cmds)):
        print("Yes")
    else:
        print("No")
    
        
    
main()   



a, b = map(int, input().split())
if a == b == 0: print('Yes')
else:
    ans = 'No'
    t = input()
    p, h = [0] * len(t), [0, 0]
    d = {'L': (-1, 0), 'R': (1, 0), 'D': (-1, 1), 'U': (1, 1)}
    for i, c in enumerate(t):
        j, k = d[c]
        h[k] += j
        p[i] = (h[0], h[1])
    if h[0] == h[1] == 0:
        if (a, b) in p: ans = 'Yes'
    elif h[0]:      
        for x, y in p:
            if (a - x) * h[1] == (b - y) * h[0] and (a - x) % h[0] == 0 and (a - x) * h[0] >= 0:
                ans = 'Yes'
                break
    else:      
        for x, y in p:
            if a == x and (b - y) % h[1] == 0 and (b - y) * h[1] >= 0:
                ans = 'Yes'
                break
    print(ans)

#!/usr/bin/env python3
import operator
table = {
        'U' : ( 0,  1),
        'D' : ( 0, -1),
        'L' : (-1,  0),
        'R' : ( 1,  0) }

a, b = list(map(int,input().split()))
s = list(input())

zs = set()
x, y = 0, 0
zs.add((x, y))
for c in s:
    x, y = list(map(operator.add, (x, y), table[c]))
    zs.add((x, y))

result = False
for (zx, zy) in zs:
    p, q = a - zx, b - zy
    if (x == 0 and p != 0) or (x != 0 and p % x != 0) or (x != 0 and p // x < 0): continue
    if (y == 0 and q != 0) or (y != 0 and q % y != 0) or (y != 0 and q // y < 0): continue
    if x != 0 and y != 0 and p // x != q // y: continue
    result = True

print('Yes' if result else 'No')


dx = {'U': 0, 'D': 0, 'L': -1, 'R': 1}
dy = {'U': 1, 'D': -1, 'L': 0, 'R': 0}
x, y, xl, yl = 0, 0, [], []
a, b = list(map(int, input().split()))
for ch in input():
    xl.append(x)
    yl.append(y)
    x += dx[ch]
    y += dy[ch]
for xi, yi in zip(xl, yl):
    mx, my = a - xi, b - yi
    if x == 0 and mx != 0 or x != 0 and (mx % x != 0 or mx // x < 0):
        continue
    if y == 0 and my != 0 or y != 0 and (my % y != 0 or my // y < 0):
        continue
    if x != 0 and y != 0 and mx // x != my // y:
        continue
    print('Yes')
    return
print('No')


X = {"R": 1, "L": -1, "U": 0, "D": 0}
Y = {"R": 0, "L": 0, "U": 1, "D": -1}

a, b = list(map(int, input().split()))
s = input()

dx, dy = 0, 0

for c in s:
    dx += X[c]
    dy += Y[c]

ret = False

# if the robot doesnt move or endpoint is the start point
if (a == 0 and b == 0):
    ret = True

cx, cy = 0, 0

for c in s:
    cx += X[c]
    cy += Y[c]
    # dx could be 0
    k = 0
    if dx != 0 and (a - cx) % dx == 0:
        k = (a - cx) // dx
    if dy != 0 and (b - cy) % dy == 0:
        k = (b - cy) // dy
    if k >= 0 and k * dx + cx == a and k * dy + cy == b:
        ret = True
if ret:
    print("Yes")
else:
    print("No")


def main():
    a, b = list(map(int, input().split()))
    s, t = input(), -100
    x = sum({"L": -1, "R": 1}.get(c, 0) for c in s)
    y = sum({"D": -1, "U": 1}.get(c, 0) for c in s)
    if x and y:
        t += min(a // x, b // y)
    elif x:
        t += a // x
    elif y:
        t += b // y
    if t > 0:
        a -= t * x
        b -= t * y
    for c in s * 101:
        if a == 0 == b:
            print("Yes")
            return
        a -= {"L": -1, "R": 1}.get(c, 0)
        b -= {"D": -1, "U": 1}.get(c, 0)
    print("No")


def __starting_point():
    main()

__starting_point()

def main():
    a, b = list(map(int, input().split()))
    steps, t = [((-1, 1, 0)["LR".find(c)], (-1, 1, 0)["DU".find(c)]) for c in input()], -25
    x = sum(e[0] for e in steps)
    y = sum(e[1] for e in steps)
    if x and y:
        t += min(a // x, b // y)
    elif x:
        t += a // x
    elif y:
        t += b // y
    if t > 0:
        a -= t * x
        b -= t * y
    for _ in range(26):
        for dx, dy in steps:
            if not (a or b):
                print("Yes")
                return
            a -= dx
            b -= dy
    print("No")


def __starting_point():
    main()

__starting_point()

3
import sys

MAPPING = {
    'U': (0, 1),
    'D': (0, -1),
    'L': (-1, 0),
    'R': (1, 0),
}


def read_ints():
    return [int(x) for x in input().split()]


def get_vectors(moves):
    vector = (0, 0)
    yield vector
    for move in moves:
        delta = MAPPING[move]
        vector = (vector[0] + delta[0], vector[1] + delta[1])
        yield vector


def mul(pair, a):
    return pair[0] * a, pair[1] * a


def is_achievable(diff, period):
    if diff == (0, 0):
        return True
    if period == (0, 0):
        return False
    if period[0] != 0:
        if diff[0] % period[0] == 0:
            times = diff[0] // period[0]
            if times > 0 and mul(period, times) == diff:
                return True
    if period[1] != 0:
        if diff[1] % period[1] == 0:
            times = diff[1] // period[1]
            if times > 0 and mul(period, times) == diff:
                return True
    return False


def main():
    a, b = read_ints()
    moves = input().strip()
    vectors = list(get_vectors(moves))
    period = vectors[-1]
    for vector in vectors:
        diff = (a - vector[0], b - vector[1])
        if is_achievable(diff, period):
            print('Yes')
            return
    print('No')


def __starting_point():
    main()

__starting_point()

#http://codeforces.com/problemset/problem/321/A

import logging as log

class Point(object):
	
	def __init__(self, x,y):
		self.x, self.y = x, y
	
	def __str__(self):
		return "({}, {})".format(self.x, self.y)
	
	def __add__(self, other):
		#add 2 points together
		return Point(self.x + other.x, self.y + other.y)
	
	def __sub__(self, other):
		#substract 2 points from each other
		return Point((other.x < self.x) & (self.x - other.x), (other.y < self.y) & (self.y - other.y))
	
	def __truediv__(self, other):
		#devide 2 points, return an integer of how many times the other is bigger than the current point
		if other.x == 0:
			return Point(0, self.y/other.y)
		elif other.y == 0:
			return Point(self.x/other.x, 0)
		else:
			return Point(self.x/other.x, self.y/other.y)
	
	def __mul__(self, other):
		#multiply 2 points
		return Point(self.x * other, self.y*other)
	
	
	def __eq__(self, other):
		#check if two points are equal
		return self.x == other.x and self.y == other.y


class CMDSeq(object):
	
	#mapping between commnads and change in X-Y co-ordinates in Point co-ordinates
	trans={	"U":Point(0, 1),
			"D":Point(0, -1),
			"R":Point(1, 0),
			"L":Point(-1, 0)}	
	
	def __init__(self, seq):
		self.seq = seq
		
		#a dictionary that saves the movesin a command sequence
		self.seq_delta = {k:0 for k in 'LURD'}
		self.parse_cmdseq()
		
		self.hori_delta = self.seq_delta['R'] - self.seq_delta['L']
		self.vert_delta = self.seq_delta['U'] - self.seq_delta['D']
		self.delta = Point(self.hori_delta, self.vert_delta)
		
		self.max_hori_delta = max(self.seq_delta['R'], self.seq_delta['L'])
		self.max_vert_delta = max(self.seq_delta['U'], self.seq_delta['D'])
		
		self.loopback_factor = max( max(self.max_hori_delta - self.hori_delta, 0),\
		 max(self.max_vert_delta - self.vert_delta, 0))
		 
		self.is_loop = self.hori_delta == self.vert_delta == 0
	
	
	def parse_cmdseq(self):
		"""translates the cmd_seq to fill the seq_delta (counts how many moves in each direction)
		"""
		for i in self.seq:
			self.seq_delta[i] += 1

	
	def repeat_ratio(self, point):
		return point/Point(self.hori_delta, self.vert_delta)
		
	def __str__(self):
		return "%s"%(self.seq)
	


def Robot():
	
	log.basicConfig(format='%(levelname)s:%(message)s', level=log.CRITICAL)
	#log.basicConfig(format='%(levelname)s:%(message)s', level=log.DEBUG)
	
	#end point
	end = Point(*[*list(map(int, input().split()))])
	log.debug('End point: %s.', end)
	
	#command sequence
	cmd = CMDSeq(input())
	log.info('Command sequence: %s.', cmd.seq)
	log.info('Command sequence delta: (%s, %s).', cmd.hori_delta, cmd.vert_delta)
	log.debug('Command max hori delta: %s.', cmd.max_hori_delta)
	log.debug('Command max vert delta: %s.', cmd.max_vert_delta)
	log.debug('Command loopback ratio: %s.', cmd.loopback_factor)
	
	"""	-If the end_point is at a totally different quarter, return No.
		-If the end_point is equal to origin, return Yes (we always start at origin no matter what the 
	command sequence is!)
		-else If the command sequence is a closed loop, new_start is at origin (0,0)
		-else:
			- Calculate the minimum number of full sequence repetitions before to get the 
			 the closes to the end point. (end / cmd.delta).
			- If the result is an integer >>> return Yes (new_start = repetition*cmd_delta)
			- else:
				new_start = cmd_delta*max(repetition - loopback, 0)
		- Start from new point then move through the sequence one step at a time and check if we 
		reached the end point, if not, return 'No'
	"""
	if end == Point(0, 0):
		log.debug('!!! End point is (0,0) !!!')
		return "Yes"
	
	elif cmd.is_loop:
		log.debug('Command sequence is a closed loop!')
		new_start_a = Point(0, 0)
		new_start_b = Point(0, 0)
	
	else:
		
		repeat = cmd.repeat_ratio(end)
		log.debug('Repeat point: %s', repeat)
		if repeat.x == 0:
			repeat = repeat.y
		elif repeat.y ==0:
			repeat = repeat.x
		else:
			repeat = min(repeat.x, repeat.y)
		
		log.debug('Repeat: %s', repeat)
		
		new_start_a = cmd.delta*max(int(repeat) - cmd.loopback_factor - 1, 0)
		new_start_b = cmd.delta*max(int(repeat) - cmd.loopback_factor, 0)
	
	log.info('New start A: %s', new_start_a)
	log.info('New start B: %s', new_start_b)
	
	log.debug('------\nWalking the robot:')
	#add the sequence to the new_start point, return YES if we hit the end point
	for rep in range(cmd.loopback_factor + 1):
		for i in cmd.seq:
			log.debug('Current command: %s', i)
			if new_start_a == end or new_start_b == end:
				return "Yes"
			new_start_a += CMDSeq.trans[i]
			new_start_b += CMDSeq.trans[i]
			log.debug('Modified start A: %s.', new_start_a)
			log.debug('Modified start B: %s.', new_start_b)
	
	return "Yes" if (new_start_a == end) or (new_start_b == end) else "No"
	

def __starting_point():
	a = Robot()
	print(a)


__starting_point()

dx = {'U': 0, 'D': 0, 'L': -1, 'R': 1}
dy = {'U': 1, 'D': -1, 'L': 0, 'R': 0}
x, y, xl, yl = 0, 0, [], []
a, b = list(map(int, input().split()))
for ch in input():
    xl.append(x)
    yl.append(y)
    x += dx[ch]
    y += dy[ch]
for xi, yi in zip(xl, yl):
    mx, my = a - xi, b - yi
    if x == 0 and mx != 0 or x != 0 and (mx % x != 0 or mx // x < 0):
        continue
    if y == 0 and my != 0 or y != 0 and (my % y != 0 or my // y < 0):
        continue
    if x != 0 and y != 0 and mx // x != my // y:
        continue
    print('Yes')
    return
print('No')


R = lambda: map(int, input().split())
a, b = R()
cs = [[0, 0]]
d = {'R': (1, 0), 'L': (-1, 0), 'U': (0, 1), 'D': (0, -1)}
for c in input():
    cs.append([cs[-1][0] + d[c][0], cs[-1][1] + d[c][1]])
px, py = cs[-1][0], cs[-1][1]
for x, y in cs:
    k = 0
    if px:
        k = (a - x) // px
    elif py:
        k = (b - y) // py
    if k >= 0 and x + k * px == a and y + k * py == b:
        print('Yes')
        return
print('No')

class CodeforcesTask321ASolution:
    def __init__(self):
        self.result = ''
        self.a_b = []
        self.command = ''

    def read_input(self):
        self.a_b = [int(x) for x in input().split(" ")]
        self.command = input()

    def process_task(self):
        vector = [0, 0]
        for c in self.command:
            if c == "U":
                vector[1] += 1
            elif c == "D":
                vector[1] -= 1
            elif c == "R":
                vector[0] += 1
            elif c == "L":
                vector[0] -= 1
        if vector[0] and vector[1]:
            turns_away = min(self.a_b[0] // vector[0], self.a_b[1] // vector[1])
        elif vector[0]:
            turns_away = self.a_b[0] // vector[0]
        elif vector[1]:
            turns_away = self.a_b[1] // vector[1]
        else:
            turns_away = 0
        turns_away = max(turns_away - 50, 0)
        x = vector[0] * turns_away
        y = vector[1] * turns_away
        can = False
        #print(vector, turns_away, x, y)
        if x == self.a_b[0] and y == self.a_b[1]:
            can = True
        for z in range(100):
            for c in self.command:
                if c == "U":
                    y += 1
                elif c == "D":
                    y -= 1
                elif c == "R":
                    x += 1
                elif c == "L":
                    x -= 1
                if x == self.a_b[0] and y == self.a_b[1]:
                    can = True
        self.result = "Yes" if can else "No"

    def get_result(self):
        return self.result


def __starting_point():
    Solution = CodeforcesTask321ASolution()
    Solution.read_input()
    Solution.process_task()
    print(Solution.get_result())

__starting_point()

def R(): return list(map(int, input().split()))
def I(): return int(input())
def S(): return str(input())

def L(): return list(R())

from collections import Counter 

import math
import sys

from itertools import permutations

import bisect

a,b=R()

s=S()
l=len(s)
step=[]

x,y=0,0

d={'U':(0,1), 'D':(0,-1), 'L':(-1,0), 'R':(1,0)}

step.append((0,0))

for i in range(l):
    dx,dy=d[s[i]]
    x+=dx
    y+=dy

    step.append((x,y))

tx,ty=step[l]

for j in range(l):
    xj,yj=step[j]

    if tx==0 and ty==0:
        if a==xj and b==yj:
            print('Yes')
            return

        else:
            continue

    if tx==0 and (a!=xj or (b-yj)%ty!=0 or ((b-yj)%ty==0 and (b-yj)/ty<0)):
        continue

    if ty==0 and (b!=yj or (a-xj)%tx!=0 or ((a-xj)%tx==0 and (a-xj)/tx<0)):
        continue

    if tx==0 or ty==0:
        print('Yes')
        return

    if (a-xj)%tx==0 and (b-yj)%ty==0 and (a-xj)/tx==(b-yj)/ty>=0:
        print('Yes')
        return


print('No')











a, b =  list(map(int, input().split()))
s = input()
p = [[0, 0]]
d = {'R': (1, 0), 'L': (-1, 0), 'U': (0, 1), 'D': (0, -1)}
for c in s:
    p.append([p[-1][0] + d[c][0], p[-1][1] + d[c][1]])
px, py = p[-1][0], p[-1][1]
for x, y in p:
    k = 0
    if px:
        k = (a - x) // px
    elif py:
        k = (b - y) // py
    if k >= 0 and x + k * px == a and y + k * py == b:
        print('Yes')
        break
else:
    print('No')


a,b = map(int,input().split())
s = list(input())
dist = a*a + b*b
lis=[[0,0]]
ver=hor=0
for i in s:
    if i=='U':
        ver+=1
    elif i=='D':
        ver-=1
    elif i=='R':
        hor+=1
    else:
        hor-=1
    lis.append([hor,ver])
flag=1

if [a,b] in lis:
    print("Yes")
    return
for i in lis:
    if [a,b]==[i[0]+lis[-1][0] , i[1]+lis[-1][0]]:
        print("Yes")
        return  
for i in range(len(lis)):
    l=0
    r=100000000000
    c,d = lis[i]
    while l<=r:
        mid = l +(r-l)//2
        e = mid*(lis[-1][0])
        f = mid*(lis[-1][1])
        if (e+c)**2 + (f+d)**2 < dist:
            l = mid+1
        else:
            r = mid-1
    if  [l*(lis[-1][0])+c , l*(lis[-1][1])+d]==[a,b]:
        print("Yes")
        flag=0
        break
    elif [r*(lis[-1][0])+c , r*(lis[-1][1])+d]==[a,b]:
        print("Yes")
        flag=0
        break
if flag:
    print("No")

import sys
ox,oy = map(int,sys.stdin.readline().split())  # original position
s= sys.stdin.readline()
h = 0
v = 0
# here we calculate the distance to target position after one simulation
for i in range (len(s)):
    if s[i] == 'R':
        h+=1
    if s[i] == 'L':
        h-= 1
    if s[i] == 'U':
        v+=1
    if s[i] == 'D':
        v -=1

def bs (l,r,a,b,rx,ry):
    l1 = l
    r1 = r
    a1 = a
    b1 = b
  #  print("ox:",a," oy:",b)
    while (l1 <= r1):
        mid = (l1+r1)//2
        a1 =a+h*mid
        b1 =b+v*mid
        # print ("   a1:",a1," b1:",b1)
        # print ("   l1:",l1," r1:",r1)
        # print ("   mid:",mid)
        if (rx == a1 and ry == b1):
            return 0
        if (rx - a1) * h == 0:
            if (ry - b1)* v >0:
                l1 = mid +1
            elif (ry - b1)* v < 0:
                 r1 = mid -1
            else:
                return -1

        if (ry - b1)* v == 0 :
            if (rx - a1) * h >0:
                l1 = mid +1
            elif (rx - a1) * h <0 :
                r1 = mid -1
            else :
                return -1

        if (rx - a1)*h != 0 and (ry - b1)* v !=0:
            if (rx - a1)*h > 0 and (ry - b1)* v >0 :
                l1 = mid+1
            elif (rx - a1)*h <0 and (ry - b1)* v <0 :
                r1 = mid-1
            else :
                return -1
    return -1

a=0
b=0
pos  = bs (0,10**9,a,b,ox,oy)
kt = False
if pos == 0:
    print("Yes")
    kt = True
if kt == False :
    for i  in range (len(s)):
        if s[i] == 'R':
            a +=1
        if s[i] == 'L':
            a -= 1
        if s[i] == 'U':
            b +=1
        if s[i] == 'D':
            b -=1
        pos= bs (0,10**9,a,b,ox,oy)
        if pos == 0 :
            print ("Yes")
            kt = True
            break
if kt == False :
    print ("No")