Problem:
 Score: 200 points    Problem Statement  Takahashi will do a tap dance. The dance is described by a string S where each character is L , R , U , or D . These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.  S is said to be easily playable if and only if it satisfies both of the following conditions:   Every character in an odd position ( 1 -st, 3 -rd, 5 -th, \ldots ) is R , U , or D .  Every character in an even position ( 2 -nd, 4 -th, 6 -th, \ldots ) is L , U , or D .   Your task is to print Yes if S is easily playable, and No otherwise.      Constraints   S is a string of length between 1 and 100 (inclusive).  Each character of S is L , R , U , or D .         Input  Input is given from Standard Input in the following format:  S       Output  Print Yes if S is easily playable, and No otherwise.        Sample Input 1 RUDLUDR      Sample Output 1 Yes  Every character in an odd position ( 1 -st, 3 -rd, 5 -th, 7 -th) is R , U , or D .  Every character in an even position ( 2 -nd, 4 -th, 6 -th) is L , U , or D .  Thus, S is easily playable.       Sample Input 2 DULL      Sample Output 2 No  The 3 -rd character is not R , U , nor D , so S is not easily playable.       Sample Input 3 UUUUUUUUUUUUUUU      Sample Output 3 Yes       Sample Input 4 ULURU      Sample Output 4 No       Sample Input 5 RDULULDURURLRDULRLR      Sample Output 5 Yes

Solution (Python):


def main():
    S = input()
    S_o = [S[i] for i in range(0, len(S)) if i % 2 == 0]
    S_e = [S[i] for i in range(0, len(S)) if not i % 2 == 0]
    if S_o.count('L') > 0:
        print('No')
    elif S_e.count('R') > 0:
        print('No')
    else:
        print('Yes')


main()

Solution (Python):
S = input()
length = len(S)

tap = True
for i in range(length):
    if (i + 1) % 2 == 1 and S[i] == "L":
        tap = False
    elif (i + 1) % 2 == 0 and S[i] == "R":
        tap = False

print("Yes" if tap else "No")

Solution (Python):
S = list(input())
flg = True
for i in range(0,len(S),2):
    if S[i] == 'L':
        flg = False
for j in range(1,len(S),2):
    if S[j]== 'R':
        flg = False
if flg:
    print('Yes')
else:
    print('No')

Solution (Python):
li = list(input())
od = li[0::2]
ev = li[1::2]
for i in range(len(od)):
    if od[i] == "R" or od[i] == "U" or od[i] == "D":
        pass
    else:
        print("No")
        exit()
for j in range(len(ev)):
    if ev[j] == "L" or ev[j] == "U" or ev[j] == "D":
        pass
    else:
        print("No")
        exit()
print("Yes")

Solution (Python):
from sys import exit
s=input()
n=len(s)
for i in range(0,n,2):
	if s[i]=="L":
		print("No")
		exit()
for i in range(1,n,2):
	if s[i]=="R":
		print("No")
		exit()
print("Yes")

Solution (Python):
S=str(input())

for i in range(len(S)):
  if i%2==0:
    if S[i]=='L':
      print('No')
      exit()
  else:
    if S[i]=='R':
      print('No')
      exit()
print('Yes')

Solution (Python):
s = input()
flag = True
for ss in range(len(s)):
    if (ss+1) % 2 == 0 and s[ss] == 'R':
        flag = False
        break
    if (ss+1) % 2 == 1 and s[ss] == 'L':
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

S = input()

for i in range(len(S)):
    if i % 2 == 0 and S[i] == 'L':
        print('No')
        sys.exit()
    elif i % 2 == 1 and S[i] == 'R':
        print('No')
        sys.exit()

print('Yes')

Solution (Python):
s = input()
flag = True
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "L":
        flag = False
    elif i % 2 == 1 and s[i] == "R":
        flag = False
print("Yes" if flag else "No")

Solution (Python):
s=input()
n=len(s)
list1=['R','U','D']
list2=['L','U','D']
listg=[]
listk=[]
for i in range(n):
  if i%2!=0:
    listg.append(i)
  else:
    listk.append(i)
list3=[]
for g in listg:
  if s[g] in list2:
    list3.append(g)
list4=[]
for k in listk:
  if s[k] in list1:
    list4.append(k)
if len(list3)==len(listg) and len(list4)==len(listk):
  print('Yes')
else:
  print('No')

Solution (Python):
import math
S=input()
count=0
for i in range(len(S)):
    if(i%2==0):
        if(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            count=count+1
    else:
        if(S[i]=="L" or S[i]=="U" or S[i]=="D"):
            count=count+1
if(count==len(S)):
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
ans=True
for i,string in enumerate(s):
    if i%2!=0:
        if string not in "LUD":
            ans=False
            break
    else:
        if string not in "RUD":
            ans=False
            break
print("Yes" if ans else "No")

Solution (Python):
def main():
    s = input()
    ans = 'Yes'
    
    for i in range(len(s)):
        if i % 2 == 0 and bool(s[i] not in {'R', 'U', 'D'}):
            ans = 'No'
            break
        elif i % 2 == 1 and bool(s[i] not in {'L', 'U', 'D'}):
            ans = 'No'
            break
    
    print(ans)

main()

Solution (Python):
S = input()
flag = True

for i in range (0, len(S), 2):
  if S[i] == "L":
    print("No")
    flag = False
    exit()

for j in range (1, len(S), 2):
  if S[j] == "R":
    print("No")
    flag = False
    exit()
    
if flag == True:
  print("Yes")

Solution (Python):
S = input()
flag = True
odd = "RUD"
even = "LUD"

for i in range(len(S)):
  if i % 2 == 0 and odd.count(S[i]) == 0:
    flag = False
    break
  elif i % 2 != 0 and even.count(S[i]) == 0:
    flag = False
    break

if flag:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
x = len(s) - 1
m = 0
n = 1
c = 0
while m <= x:
  if s[m] == 'L':
    c += 1
  m += 2
while n <= x:
  if s[n] == 'R':
    c += 1
  n += 2
if c == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
s_odd = s[::2]
s_even = s[1::2]
if "L" in s_odd or "R" in s_even:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()
a = 'L' in s[::2]  
b = 'R' in s[1::2] 
print('No' if a or b else 'Yes')

Solution (Python):
s = input()
count = 0
flag = "ok"
for i in s:
    
    count += 1
    if count % 2 == 0:
        if i == "R":
            flag = "ng"
            break
    else:
        if i == "L":
            flag = "ng"
            break
if flag == "ok":
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 

s = input()

for i in range(0, len(s), 2):
    if s[i] == 'L':
        print('No')
        sys.exit()
for i in range(1, len(s), 2):
    if s[i] == 'R':
        print('No')
        sys.exit()
print('Yes')

Solution (Python):
import sys
s = sys.stdin.readline().strip()
flag = True
i = 0
while i < len(s):
  if i % 2:
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  else:
    if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  i += 1
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
S=input()
for i in range(len(S)):
  if((i+1)%2==1 and S[i]=='L'):
    print("No")
    exit()
  if((i+1)%2==0 and S[i]=='R'):
    print("No")
    exit()
print("Yes")

Solution (Python):
s = input()

for i in range(0,len(s),2):
        if s[i] == "L":
                print("No")
                exit()

for i in range(1,len(s),2):
        if s[i] == "R":
                print("No")
                exit()

print("Yes")

Solution (Python):
s = input()
odd = ["R", "U", "D"]
gu = ["L", "U", "D"]
flag = False
for i in range(len(s)):
    if i % 2 == 0:
        if not (s[i] in odd):
            flag = True
            break
    else:
        if not (s[i] in gu):
            flag = True
            break

if flag:
    print("No")
else:
    print("Yes")

Solution (Python):
ss=input()
for i,s in enumerate(ss):
  if (i+1)%2!=0 and s=='L':
    print('No')
    exit(0)
  elif (i+1)%2==0 and s=='R':
    print('No')
    exit(0)
print('Yes')

Solution (Python):
s = input()
for i in range(len(s)):
    if i % 2 == 1:
        if s[i] == 'R':
            print("No")
            exit()
    if i % 2 == 0:
        if s[i] == 'L':
            print("No")
            exit()
print("Yes")

Solution (Python):
import sys
S = input()
idx = 1
for s in S:
  if idx%2==1:
    if not(s=='R' or s=='U' or s=='D'):
      print('No')
      sys.exit()
    else:
      idx+=1
  else:
    if not(s=='L' or s=='U' or s=='D'):
      print('No')
      sys.exit()
    else:
      idx+=1
print('Yes')

Solution (Python):
s = input()
f = True
for i in range(len(s)):
    if i%2 == 0:
        if s[i] == 'L':
            f = False
            break
    
    else:
        if s[i] == 'R':
            f = False
            break
if f:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
odd = s[0::2]
even = s[1::2]

print(["Yes","No"]["L" in odd or "R" in even])

Solution (Python):
def resolve():
    s=input()
    ans='Yes'
    for i in range(len(s)):
        if i%2==0:
            if s[i]=='L':
                ans='No'
        else:
            if s[i]=='R':
                ans='No'
    print(ans)
resolve()

Solution (Python):
def resolve():
    s=input()
    if 'R' in s[1::2] or 'L' in s[::2]:
        print('No')
    else:
        print('Yes')
resolve()

Solution (Python):



k = ["R","U","D"]
g = ["L","U","D"]
S = list(input())
ans = "Yes"

for n,s in enumerate(S):
    if(n % 2 == 0):
        if((s in k) == False):
            ans = "No"
            break
    else:
        if((s in g) == False):
            ans = "No"
            break
print(ans)

Solution (Python):
import sys

s= input()
dic = {0:'R',1:'L'}
for i in range(len(s)):
  if s[i] == dic[(i+1)%2]:
    print('No')
    sys.exit()
    
print('Yes')

Solution (Python):
S = input()
k = False
for i, s in enumerate(S):
    if (i+1) % 2 == 0:
        if s == "L" or s == "U" or s == "D":
            k = True
        else:
            k = False
            break
    else:
        if s == "R" or s == "U" or s == "D":
            k = True
        else:
            k = False
            break

if k:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
count = 0
for i in range(len(s)):
    if (i+1)%2 == 0:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            count += 1
    else:
        if s[i] =='R' or s[i] == 'U' or s[i] == 'D':
            count += 1
if len(s) == count:
    print('Yes')
else:
    print('No')

Solution (Python):

s = list(input())

for i in range(1,len(s)+1):
    if i % 2 == 1:
        if s[i-1] == "L":
            print("No")
            exit()
    else:
        if s[i-1] == "R":
            print("No")
            exit()
print("Yes")

Solution (Python):
s=input()
flg=False

for i in range(len(s)):
  if (i+1)%2==0 and s[i]=='R':
    flg=True
  if (i+1)%2==1 and s[i]=='L':
    flg=True
if flg:
  print('No')
else:
  print('Yes')

Solution (Python):

S = input()
even = set(S[1::2])
odd = set(S[0::2])
ans = 'Yes'

for i in odd:
    if i not in ['R', 'U', 'D']:
        print('No')
        exit()
for i in even:
    if i not in ['L', 'U', 'D']:
        print('No')
        exit()

print(ans)

Solution (Python):
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce


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


def INT(): return int(input())


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


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


def ZIP(n): return zip(*(MAP() for _ in range(n)))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
	S = input()

	for i, x in enumerate(S):
 		if i%2==0 and x=='L':
 			print("No")
 			exit()
 		if i%2==1 and x=='R':
 			print("No")
 			exit()
	else:
 		print("Yes")

if __name__ == '__main__':
    main()

Solution (Python):
S = input()
for i,s in enumerate(S):
  if s == 'R' and i%2 == 1:
    print('No')
    break
  elif s == 'L' and i%2 == 0:
    print('No')
    break
else:
  print('Yes')

Solution (Python):
s = input()
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
b = True
k = 0
for i in range(len(s)):
    k += 1
    if k%2 == 0:
        if s[i] in even:
            continue
        else:
            b = False
            break
    else:
        if s[i] in odd:
            continue
        else:
            b = False
            break

if b:
    print('Yes')
else:
    print('No')

Solution (Python):
import numpy as np
S = input()
l = len(S)
oddArr = np.arange(1,l+1,2)
evenArr = np.arange(2,l+1,2)
playable = True
for i in oddArr:
    if S[i-1]=='R' or S[i-1]=='U' or S[i-1]=='D':
        continue
    else:
        playable = False
        break
if playable:
    for i in evenArr:
        if S[i-1] == 'L' or S[i-1] == 'U' or S[i-1] == 'D':
            continue
        else:
            playable = False
            break
if playable:
    print('Yes')
else:
    print('No')

Solution (Python):
s = str(input())
if s[0:len(s)+1:2].count("L")>0 or s[1:len(s)+1:2].count("R")>0:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()

ans ="Yes"
for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "L":
            ans = "No"
    else:
        if s[i] == "R":
            ans = "No"

print(ans)

Solution (Python):
import sys
s = input()

for i, name in enumerate(s):
    if (i + 1) % 2 != 0:
        if name == 'L':
            print('No')
            sys.exit()
    else:
        if name == 'R':
            print('No')
            sys.exit()

print('Yes')

Solution (Python):

a = input()

print("No" if any([(i % 2 == 0 and a[i] == 'L') or
                   (i % 2 == 1 and a[i] == 'R') for i in
                   range(len(a))]) else "Yes")

Solution (Python):
S = str(input())
od = ['R', 'U', 'D']
nod = ['L', 'U', 'D']

j = True
for i in range(len(S)):
    if i%2 == 0:
        if S[i] not in od:
            print("No")
            exit()
    else:
        if S[i] not in nod:
            print("No")
            exit()

print('Yes')

Solution (Python):
s = input()
flg = 0
for i in range(len(s)):
  if i % 2 == 0 and s[i] == 'L':
    flg = 1
  if i % 2 == 1 and s[i] == 'R':
    flg = 1
if flg == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
S=list(input())
for i in range(len(S)):
    
    if i%2==0:
        if S[i]=="L":
            print("No")
            exit()
    
    if i%2==1:
        if S[i]=="R":
            print("No")
            exit()
print("Yes")

Solution (Python):
import re
s = input()
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(s):
  print("Yes")
else:
  print("No")

Solution (Python):
s = list(input())
for i in range(len(s)):
  if (i+1)%2 == 1 and s[i] == 'L':
    print('No')
    exit()
  elif (i+1)%2 == 0 and s[i] == 'R':
    print('No')
    exit()
print('Yes')

Solution (Python):
a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
    if int(c)%2==1:
        x=x+ans[i]
    elif int(c)%2==0:
        x=x+ans2[i]
    c=c+1
if x>=1:
	print("No")
else:
  	print("Yes")

Solution (Python):
a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
	if int(c)%2==1:
		x=x+ans[i]
	elif int(c)%2==0:
		x=x+ans2[i]
	c=c+1
if x>=1:
	print("No")
else:
	print("Yes")

Solution (Python):
n = input()
t = 1
for i in range(len(n)):
    if i%2==0:
        if n[i] == "L":
            t=0
            break
    else:
        if n[i]== "R":
            t = 0
            break
if t ==1:
    print("Yes")
else:print("No")

Solution (Python):
S = input()
print("No" if "L" in S[0::2] or "R" in S[1::2] else "Yes")

Solution (Python):
s = input()
'''
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

for i in range(len(s)):
    if (i+1) % 2 == 1:
        if s[i] not in odd:
            print('No')
            exit(0)
    else:
        if s[i] not in even:
            print('No')
            exit(0)

print('Yes')

'''

odd = s[::2]
even = s[1::2]

if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
from io import StringIO
import unittest


def resolve():
    s = input()

    odd = set(['R', 'U', 'D'])
    even = set(['L', 'U', 'D'])

    ans = True

    for i, ss in enumerate(s):
        if (i + 1) % 2 == 0 and ss in even:
            continue
        elif (i + 1) % 2 == 1 and ss in odd:
            continue
        else:
            ans = False
            break

    if ans:
        print('Yes')
    else:
        print('No')


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """RUDLUDR"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """DULL"""
        output = """No"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """UUUUUUUUUUUUUUU"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """ULURU"""
        output = """No"""
        self.assertIO(input, output)
    def test_入力例_5(self):
        input = """RDULULDURURLRDULRLR"""
        output = """Yes"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

Solution (Python):
s = input()
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

for i in range(len(s)):
    if (i+1) % 2 == 1:
        if s[i] not in odd:
            print('No')
            exit(0)
    else:
        if s[i] not in even:
            print('No')
            exit(0)

print('Yes')

Solution (Python):
s = input()

check = ["L", "R"]

ans = "Yes"
for i, c in enumerate(s):
    if c == check[i % 2]:
        ans = "No"
        break
print(ans)

Solution (Python):
s = input()

o = s[::2]
e = s[1::2]

ans = "Yes" if ("L" not in o) and ("R" not in e) else "No" 
print(ans)

Solution (Python):
s=input()
l=len(s)

for i in range(1, l+1):
    if i%2==1:
        if s[i-1]=="R" or s[i-1]=="U" or s[i-1]=="D":
            pass
        else:
            print("No")
            exit()
    else:
        if s[i-1]=="L" or s[i-1]=="U" or s[i-1]=="D":
            pass
        else:
            print("No")
            exit()
print("Yes")

Solution (Python):

S = input()
taps_odd = set('RUD')
taps_even = set('LUD')

print('Yes' if len(set(S[::2]) - taps_odd) == 0 and len(set(S[1::2]) - taps_even) == 0 else 'No')

Solution (Python):
S = input()

odd = {c for i, c in enumerate(S, 1) if i % 2 != 0}
even = {c for i, c in enumerate(S, 1) if i % 2 == 0}

if odd.issubset({ 'R', 'U', 'D' }) and even.issubset({ 'L', 'U', 'D' }):
  print('Yes')
else:
  print('No')

Solution (Python):
import os

def main():
	s = input()
	count = 0
	flag = True
	for i in s:
		count += 1
		if count%2 == 0:
			if i == "R":
				flag = False
				break
		else:
			if i == "L":
				flag = False
				break
	if flag:
		print("Yes")
	else:
		print("No")	


if __name__ == "__main__":
	main()

Solution (Python):

import sys
import numpy as np

YES = "Yes"  
NO = "No"  


def solve(S: str):
    for i in range(len(S)):
        if i%2==0 and S[i]=='L':
            print(NO)
            return
        if i%2==1 and S[i]=='R':
            print(NO)
            return 
    print(YES)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
flag = 0

for i in range(len(s)):
    if (i+1) % 2 == 1:
        if s[i] == "L":
            flag = 1
    else:
        if s[i] == "R":
            flag = 1
if flag == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
a = ['R', 'U', 'D']
b = ['L', 'U', 'D']

for i in range(len(s)):
    if (i + 1) % 2 == 0:
        if s[i] not in b:
            print('No')
            exit(0)
    else:
        if s[i] not in a:
            print('No')
            exit(0)

print('Yes')

Solution (Python):

S =input()


flag = True

for i,v in enumerate(S):
    if (i+1) %2 ==1 and v in "RUD":
        flag ="Yes"
    elif(i+1) %2 ==1 and v not in "RUD":
        flag ="No"
        break
    if (i+1) %2 ==0 and v in "LUD":
        flag ="Yes"
    elif(i+1) %2 ==0 and v not in "LUD":
        flag ="No"
        break
print(flag)

Solution (Python):
s = input()
ret = True
for c in s[::2]:
    if c not in ['R', 'U', 'D']:
        ret =False
for c in s[1::2]:
    if c not in ['L', 'U', 'D']:
        ret =False
if ret:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
od = ["R","U","D"]
ev = ["L","U","D"]
f = True
for i in range(len(s)):
    if i%2==0:
        if s[i]in od:pass
        else: f=False
    if i%2==1:
        if s[i]in ev:pass
        else: f=False
if f:print("Yes")
else:print("No")

Solution (Python):
s = input()

odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

for i in range(len(s)):
    if i % 2 == 0 and s[i] not in odd:
        print('No')
        exit()
    elif i % 2 == 1 and s[i] not in even:
        print('No')
        exit()

print('Yes')

Solution (Python):
import itertools




s = input()
ok  = "Yes"
for i in range(1,len(s)+1):
    
    if i%2 == 0:
        if s[i-1]=="R":
            ok = "No"
    else:
        if s[i-1] == "L":
            ok = "No"

print(ok)

Solution (Python):
S=input()
flag=0
for i in range(len(S)):
  now=S[i]
  if i%2==1 and (now=="L" or now=="U" or now=="D"):
    continue
  elif i%2==0 and (now=="R" or now=="U" or now=="D"):
    continue
  else:
    print("No")
    flag=1
    break
if flag==0:
  print("Yes")

Solution (Python):
S = input()

cnt =1
okflg = True

for s in S:
    
    if cnt%2==0:
        if s!="L"and  s!="U" and s!="D":
            okflg = False
            break
    else:
        if s!="R" and s!="U" and s!="D":
            okflg = False
            break
            
    cnt = cnt+1

if okflg ==True:
    print("Yes")
else:
    print("No")

Solution (Python):
icase=0
if icase==0:
    s=list(input())
    od={"R","U","D"}
    ev={"L","U","D"}
    yn=""
    for i in range(0,len(s),2):
        if not s[i] in od:
            yn="No"
            break
    if yn!="No":
        for i in range(1,len(s),2):
            if not s[i] in ev:
                yn="No"
                break
    if yn=="No":
        print("No")
    else:
        print("Yes")

Solution (Python):
S = input()

N=len(S)
flag=1

for i in range(N):
  if i%2==0 and S[i]=='L':
    flag=0
  elif i%2==1 and S[i]=='R':
    flag=0

print('Yes' if flag==1 else 'No')

Solution (Python):
s = input()
ans = True
for i in s[::2]:
    if i == "L":
        ans = False
for i in s[1::2]:
    if i == "R":
        ans = False
if ans:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

s=str(input())

for i in range(len(s)):
  if (i+1)%2==1:
    if s[i]=="R" or s[i]=="U" or s[i]=="D":
      continue
    else:
      print("No")
      sys.exit()

  else:
    if s[i]=="L" or s[i]=="U" or s[i]=="D":
      continue
    else:
      print("No")
      sys.exit()

print("Yes")

Solution (Python):
def main():
    S = input()
    odd = True
    even = True
    for i in range(len(S)):
        if (i + 1) % 2 == 0:
            if S[i] == "R":
                even = False
        else:
            if S[i] == "L":
                odd = False
    if even and odd:
        print("Yes")
    else:
        print("No")
main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = len(S)

for i in range(-(-N//2)):
  if S[i*2] == "L":
    print("No")
    exit()
    
for i in range(N//2):
  if S[i*2+1] == "R":
    print("No")
    exit()

    
print("Yes")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = len(S)

for i in range(-(-N//2)):
  if S[i*2] == "L":
    print("No")
    exit()
    
for i in range(N//2):
  if S[i*2+1] == "R":
    print("No")
    exit()
    
if N%2 == 1:
  if S[N-1] == "L":
    print("No")
    exit()
    
print("Yes")

Solution (Python):
s = list(str(input()))
if "L" in s[::2] or "R" in s[1::2]:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()
output = 'Yes'
for i in range(len(s)):
    if i % 2 == 0 and s[i] == 'L':
        output = 'No'
        break
    elif i % 2 != 0 and s[i] == 'R':
        output = 'No'
        break

print(output)

Solution (Python):
s = input()

if "L" in s[::2] or "R" in s[1::2]:
    print("No")
else:
    print("Yes")

Solution (Python):
s = list(input())

a = 0
b = 0
ans = 0

for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            a += 1
    else:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
             b += 1

if len(s)%2 == 0:
    if a == (len(s))//2 and b == len(s)//2:
        ans = 1
else:
    if a == (len(s)+1)//2 and b == (len(s)-1)//2:
        ans = 1
if ans ==1:
    print("Yes")
else:
    print("No")

Solution (Python):
string = str(input())
flag = True
for i in range(len(string)):
	if (i+1)%2==0:
		if( string[i]!='L' and string[i]!='U' and string[i]!='D' ):
			
			flag = False
			break
	else:
		if ( string[i]!='R' and string[i]!='U' and string[i]!='D' ):
			flag = False
			
			break
if(flag):
	print("Yes")
else:
	print("No")

Solution (Python):
S=input()
if "L" in S[::2] or "R"in S[1::2]:
    print("No")
else:
    print("Yes")

Solution (Python):
S=list(map(str,input()))
N=len(S)

count=0
for i in range(N):
  if i %2==0:
    if S[i]=="L":
      count+=1
    else:
      count+=0
  if i %2==1:
    if S[i]=="R":
      count+=1
    else:
      count+=0
if count==0:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  S = input()
  L = len(S)
  ans = 'Yes'
  for i in range(L):
    if i %2==0:
      if S[i]=='L':
        ans = 'No'
        break
    else:
      if S[i] == 'R':
        ans = 'No'
        break
  print(ans)
  
  
if __name__ == '__main__':
  main()

Solution (Python):
def main():
    s = input()
    flag = False
    for i in s[0:len(s):2]:
        if i not in ["R", "U", "D"]:
            flag = True
    for i in s[1:len(s):2]:
        if i not in ["L", "U", "D"]:
            flag = True
    if flag:print("No")
    else:print("Yes")
         

if __name__ == "__main__":
    main()

Solution (Python):
s=input()
s=[str(c) for c in s]
x1=s[0::2]
x2=s[1::2]

l1=len(x1)
l2=len(x2)
k=0
for i in range(l1):
  if x1[i]=="R" or x1[i]=="U" or x1[i]=="D":
    k+=1
for i in range(l2):
  if x2[i]=="L" or x2[i]=="U" or x2[i]=="D":
    k+=1
if k==l1+l2:
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
print("No" if ("L" in S[0::2]) or ("R" in S[1::2]) else "Yes")

Solution (Python):
import sys

s = input()

for i in range(len(s)):
	if i % 2 == 0 and s[i] == 'L':
		print('No')
		sys.exit()
	elif i % 2 == 1 and s[i] == 'R':
		print('No')
		sys.exit()

print('Yes')

Solution (Python):
S = input()
count = 0

for i, n in enumerate(S):
    if (i + 1) % 2 == 0:
        if n == "L" or n == "U" or n == "D":
            count += 1
    else:
        if n == "R" or n == "U" or n == "D":
            count += 1

if len(S) == count:
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
flag=0
for i in range(0,len(S)):
  if i%2==0 and S[i]=='L':
    flag=1
  if i%2==1 and S[i]=='R':
    flag=1
if flag==0:
  print('Yes')
else:
  print('No')

Solution (Python):
S=input()

o=S[::2]
e=S[1::2]

if "R" in e or "L" in o:
    print("No")
else:
    print("Yes")

Solution (Python):
S = input()
s = list()
for a in S:
    s.append(a)

even = s[1::2]
odd = s[0::2]

if 'R' not in even and 'L' not in odd:
    print('Yes')
else:
    print('No')

Solution (Python):
def Inn(s):
    for i in range(len(s)):
        if i%2 == 0:
            if s[i] not in ['R', 'U', 'D']:
                return "No"
        else:
            if s[i] not in ['L', 'U', 'D']:
                return "No"
    return "Yes"

s = input()
print(Inn(s))

Solution (Python):
s = input()
n = len(s)
kisu = ["R", "U", "D"]
gusu = ["L", "U", "D"]
for i in range(n):
    if i % 2 == 0:
        if s[i] in kisu:
            continue
    else:
        if s[i] in gusu:
            continue
    print("No")
    exit()
print("Yes")

Solution (Python):
s = str(input())

result = 'Yes'

for i in range(len(s)):
  if i%2==0:
    if s[i] == 'L':
      result = 'No'
  else:
    if s[i] == 'R':
      result = 'No'
print(result)

Solution (Python):
s = list(input())
for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    print('No')
    exit()
  if i%2!=0 and s[i]=='R':
    print('No')
    exit()
print('Yes')

Solution (Python):
S = input()
O = []
E = []
for i in range(len(S)):
    if i % 2 == 0:
        O.append(S[i])
    else:
        E.append(S[i])
if 'L' in O or 'R' in E:
    print('No')
else:
    print('Yes')

Solution (Python):
S = list(input())

flag = True
for i, s in enumerate(S):
  if (i+1) % 2 == 0:
    if s == 'R':
      flag = False
  else:
    if s == 'L':
      flag = False
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
S = input()
Kisuuretu = S[::2]
Guusuuretu = S[1::2]
if Kisuuretu.count("L") == 0 and Guusuuretu.count("R") == 0:
	print("Yes")
else:
	print("No")

Solution (Python):
s = input()
o = s[::2]
e = s[1::2]
if "L" not in o and "R" not in e:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
cnt = 0
for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "L":
            cnt += 1
    if i%2 == 1:
        if s[i] == "R":
            cnt += 1
if (cnt == 0):
    print("Yes")
else:
    print("No")