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):
s = list(input())
ans = 0
if len(s)%2==0:
    for i in range(len(s)//2):
        if s[2*i]=="L" or s[2*i+1]=="R":
            ans += 1
            break
elif len(s)%2!=0:
    for i in range(len(s)//2):
        if s[2*i]=="L":
            ans += 1
            break
        elif s[2*i+1]=="R":
            ans += 1
            break
    if s[-1]=="L":
        ans += 1

if ans==0:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
ans = 0
if len(s)%2==0:
    for i in range(len(s)//2):
        if s[2*i]=="L" or s[2*i+1]=="R":
            ans += 1
            break
        else:
            continue
elif len(s)%2!=0:
    for i in range(len(s)//2):
        if s[2*i]=="L":
            ans += 1
            break
        elif s[2*i+1]=="R":
            ans += 1
            break
        else:
            continue
    if s[-1]=="L":
        ans += 1

if ans==0:
    print("Yes")
else:
    print("No")

Solution (Python):
s =input()
x=["L","R"]

ans="Yes"
for i in range(len(s)):
    if s[i]==x[i%2]:
        ans="No"
        break
print(ans)

Solution (Python):
s = input()

OD = {"D", "R", "U"}
EV = {"D", "L", "U"}

if ((set(s[::2])) <= OD) and ((set(s[1::2])) <= EV):
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
k=len(s)
if all([s[i] in ['U','D','R'] for i in range(0,k,2)]) and all([s[j] in ['U','D','L'] for j in range(1,k,2)]):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

flag = True
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] not in ['R', 'U', 'D']:
      flag = False
      break
  else:
    if s[i] not in ['L', 'U', 'D']:
      flag = False
      break
  
result = 'Yes' if flag else 'No'
print(result)

Solution (Python):
s = input()
check=1
flag=0
for i in s:
    
    if check ==1:
        if i == "R" or i == "U" or i=="D":
            check=0
            continue
        else:
            flag=1
    else:
        if i == "L" or i == "U" or i=="D":
            check=1
            continue
        else:
            flag=1

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

Solution (Python):



S = input()


cond1 = sum([s == 'L' for s in S[::2]])
cond2 = sum([s == 'R' for s in S[1::2]])


if cond1 == 0 and cond2 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

flag = True
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "L":
            flag = False
            break
    else:
        if s[i] == "R":
            flag = False
            break

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

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

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

Solution (Python):
text = input()

if all(text[i * 2] != "L" for i in range((len(text) + 1) // 2)) and \
   all(text[i * 2 + 1] != "R" for i in range(len(text) // 2)):
  print("Yes")
else:
  print("No")

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

even = ['R','U','D']
odd = ['L','U','D']
ans = 'Yes'
for i in range(len(S)):
    if (i%2 == 0 and S[i] not in even) or (i%2 == 1 and S[i] not in odd):
        ans = 'No'
        break
print(ans)

Solution (Python):
S = 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()
ans = "Yes"
for i in range(0,len(S),2):
	if not(S[i] == "R" or S[i] == "U" or S[i] == "D"):
		ans = "No"
		break
	if(i < len(S)-1):
		if not(S[i+1] == "L" or S[i+1] == "U" or S[i+1] == "D"):
			ans = "No"
			break
print(ans)

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

S_odd = []
S_even = []

for i in range(0, length, 2):
    S_odd.append(S[i])

for i in range(1, length, 2):
    S_even.append(S[i])


if ("L" in S_odd) or ("R" in S_even):
    print("No")
else:
    print("Yes")

Solution (Python):
S=input()
flag=True
for i in range(len(S)):
   if (i+1)%2==1:
      if S[i]=="L":
         flag=False
   else:
      if S[i]=="R":
         flag=False

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

Solution (Python):
s = input()

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

print('Yes')

Solution (Python):
S = input()
odd = S[1::2]
even = S[::2]
for i in odd:
    if i=='R':
        print('No')
        exit()
for i in even:
    if i=='L':
        print('No')
        exit()
print('Yes')

Solution (Python):
s=input()
a=0
for i in range(len(s)):
    if i%2==0 and s[i]!='L':
        a+=1
    elif i%2!=0 and s[i]!='R':
        a+=1
if a==len(s):
    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()
  else:
    if S[i] == "R":
      print("No")
      exit()
      
print("Yes")

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

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

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

Solution (Python):
S=input()
c=0
for m in range(len(S)):
    if m%2==0:
        if S[m]=="L":
            print("No")
            break
    elif m%2==1:
        if S[m]=="R":
            print("No")
            break
    c+=1
if c==len(S):
    print("Yes")

Solution (Python):
S = input()
s1 = S[1::2]
s2 = S[::2]


if "L" in s2 or "R" in s1:
    print("No")
else:
    print("Yes")

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

Solution (Python):
A = list(input())
import math
B = []
C = []
count = 0
for i in range(math.ceil(len(A) / 2)):
    B.append(A[count])
    count += 2
count = 1
for i in range(math.floor(len(A) / 2)):
    C.append(A[count])
    count += 2
if "L" not in B and "R" not in C:
    print("Yes")
else:
    print("No")

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





if __name__ == '__main__':
	main()

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

ans = "Yes"
for i in range(len(S)):
    if i %2 ==0:
        if S[i]=="L":  
            ans = "No"
            break
    if i %2 != 0:
        if S[i]=="R":
            ans = "No"
            break
        
print(ans)

Solution (Python):
import sys


S = input()

for i, s in enumerate(S):
  if i % 2:
    if s == 'R':
      print("No")
      sys.exit()
  else:
    if s == 'L':
      print("No")
      sys.exit()
      
print("Yes")

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

YES = "Yes"  
NO = "No"  

def solve(S: str):
    if all([S[i-1] != 'R' if i%2 == 0 else S[i-1] != 'L' for i in range(1, len(S)+1)]):
        print(YES)
    else:
        print(NO)
    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=str(input())
out=["Yes","No"]
flg=0

for i in range(len(S)):
    if i%2==0:
        if S[i]!="R" and S[i]!="U" and S[i]!="D":
            flg=1
            break
    if i%2==1:
        if S[i]!="L" and S[i]!="U" and S[i]!="D":
            flg=1
            break

print(out[flg])

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 count==len(S):
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
kisuu={'R','U','D'}
guusuu={'L','U','D'}

res = True


for c in S[::2]:
    res = res and c in kisuu


for c in S[1::2]:
    res = res and c in guusuu

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

Solution (Python):
S = input()

for idx, s in enumerate(S):
    if (idx % 2 == 1) and (s == 'R') or (idx % 2 == 0) and (s == 'L'):
        print('No')
        exit()

print('Yes')

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

Solution (Python):
s = input()
d = {}
d[0] = ["R", "U", "D"]
d[1] = ["L", "U", "D"]
res = True
for i in range(len(s)):
    if s[i] not in d[i%2]:
        res = False

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

Solution (Python):
s=input()
od=s[::2]
ev=s[1::2]
if od.count('L')+ev.count('R')==0:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()

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

print("Yes")

Solution (Python):
c=1
a=set()
b=set()
for i in input():
    if c%2==0:
        b.add(i)
    else:
        a.add(i)
    c+=1
if 'R' not in b and "L" not in a:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
N = len(S)
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
ans = 0

for i in range(0, N, 2):
  if not (S[i] in odd):
    ans += 1
for i in range(1, N, 2):
  if not(S[i] in even):
    ans += 1
 
if ans == 0:
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

def is_easy_to_tap(s):
    for i, c in enumerate(s):
        if((i % 2 == 0) and (c == 'L')):
            return 'No'
        if((i % 2 != 0) and (c == 'R')):
            return 'No'
    return 'Yes'

print(is_easy_to_tap(s))

Solution (Python):
S = input()
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
rslt = 'Yes'
for idx, s in enumerate(S):
    if idx%2==1 and s in even:
        continue
    elif idx%2==0 and s in odd:
        continue
    else:
        rslt = 'No'
        break
print(rslt)

Solution (Python):
S = input().strip()

b = True

for i in range(len(S)):
    s = S[i]
    if i % 2 == 0:
        if s == 'L':
            b = False
    else:
        if s == 'R':
            b = False

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

Solution (Python):
S = input()
odd = ('R', 'U', 'D')
even = ('L', 'U', 'D')
flg = True

for i in range(0, len(S), 2):
    if S[i] not in odd:
        flg = False

for i in range(1, len(S), 2):
    if S[i] not in even:
        flg = False

print('Yes') if flg == True else print('No')

Solution (Python):
import re


def main(s: str):
    if re.match(r'^([^L][^R])*[^L]?$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)

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

print(ans)

Solution (Python):
S = str(input())
ans = 0
for i in range(len(S)):
    if i%2 == 0:
        if S[i] != 'R' and S[i] !='U' and S[i] !='D':
            print('No')
            exit()
    else:
        if S[i] !='L' and S[i] !='U' and S[i] !='D':
            print('No')
            exit()
print('Yes')

Solution (Python):
s = input()

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

Solution (Python):
S = input()
N = len(S)
for i in range(1,N+1):
    if i % 2 == 0:
        if S[i-1] not in ['L','U','D']:
            print('No')
            exit()
    else:
        if S[i-1] not in ['R', 'U', 'D' ]:
            print('No')
            exit()

print('Yes')

Solution (Python):
s = input()
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] != "L":
            pass
        else:
            print("No")
            break
    elif i % 2 == 1:
        if s[i] != "R":
            pass
        else:
            print("No")
            break
    if i == len(s)-1:
        print("Yes")

Solution (Python):
s = str(input())
n = len(s)
a = 0
for i in range(0,n):
    if (i % 2)== 1:
        if s[i] == 'R':
            a = 1

    else:
        if s[i] == 'L':
            a = 1


if a == 1:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()

def func(s):
    for i in range(0, len(s), 2):
        if s[i] not in "RUD":
            return "No"

    for i in range(1, len(s), 2):
        if s[i] not in "LUD":
            return "No"

    return "Yes"

print(func(s))

Solution (Python):
s = input()

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

c = 0

for i in range(len(s)):
    if (i+1) % 2 == 1:
        if s[i] in odd:
            c += 1
    else:
        if s[i] in even:
            c += 1

            
    
if len(s) == c:
    print('Yes')

else:
    print('No')

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

flg = 0

for i in range(len(s)):
    
    if i%2 == 0 and s[i] == "L":
        flg = 1
    
    elif i%2 ==1 and s[i] == "R":
        flg = 1


if flg == 1:
    print("No")
else:
    print("Yes")

Solution (Python):
S=input().strip()

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

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

for i in range(len(s)):
    if i%2==0 and s[i] in odd:
        tmp += 1
    elif i%2!=0 and s[i] in even:
        tmp += 1

print('Yes' if tmp==len(s) else 'No')

Solution (Python):
input_tap = input()
flag = 'No'
input_tap1 = input_tap[0::2]
input_tap2 = input_tap[1::2]

if 'L' in input_tap1:
    flag = 'No'
elif 'R' in input_tap2:
    flag = 'No'
else:
    flag = 'Yes'
print(flag)

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

Solution (Python):
s = input()
a = 0
for i in range(len(s)):
    if i % 2 == 0 and s[i] in ["R", "U", "D"]:
        a += 1
    elif i % 2 == 1 and s[i] in ["L", "U", "D"]:
        a += 1
    else:
        print("No")
        break
if a == len(s):
    print("Yes")

Solution (Python):
s = list(input())
s1 = s[0::2]
s2 = s[1::2]

if "L" in s1:
    print("No")
elif "R" in s2:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()

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

print('Yes')

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

Solution (Python):
li = list(input())
li_even = ["L", "U", "D"]
li_odd = ["R", "U", "D"]
flag = True

for i in range(1, len(li)+1):
    if i%2 == 0: 
        if li[i-1] not in li_even:
            flag = False
            break
    else: 
        if li[i-1] not in li_odd:
            flag = False
            break
            
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
l = len(s)
h = int(l/2)

if l % 2 ==0:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    print('Yes')

else:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    if s[l-1] == 'L':
      print('No')
    else:
      print('Yes')

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

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

check_odd = ["R", "U", "D"]
check_even = ["L", "U", "D"]


def Odd():
    for i in S[0::2]:
        if i not in check_odd:
            return True
            break


def Even():
    for j in S[1::2]:
        if j not in check_even:
            return True
            break


if Odd() or Even():
    print("No")
else:
    print("Yes")

Solution (Python):
import sys

a = input()
l = True

for i in range(len(a)):
    if i % 2 == 1:
        if a[i] == 'R':
            l = False

    if i % 2 == 0:
        if a[i] == 'L':
            l = False

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

Solution (Python):
from sys import stdin

char = stdin.readline().rstrip()

for i,c in enumerate(char):
    if i %2 ==0:
        if c not in ("R",'U','D'):
            print('No')
            break
    else:
        if c not in ("L",'U','D'):
            print('No')
            break
else:
    print('Yes')

Solution (Python):
s = input()

count = 0

for i in range(len(s)):
  if i % 2 == 0:
    if s[i] != 'L':
      count += 1
  else:
    if s[i] != 'R':
      count += 1

if count == len(s):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

maybe = True

def ok1(c):
    if c == 'R' or c == 'U' or c == 'D':
        return True
    return False

def ok2(c):
    if c == 'L' or c == 'U' or c == 'D':
        return True
    return False


for i in range(0 , len(s) , 2):
    if not ok1(s[i]):
        maybe = False

for i in range(1 , len(s), 2):
    if not ok2(s[i]):
        maybe = False




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

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    S=input()
    for i,s in enumerate(S,1):
        if(i&1 and s=='L'):
            print("No")
            return
        if(i&1==0 and s=='R'):
            print("No")
            return
    print("Yes")
resolve()

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

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

can = True

for i in range(len(S)):
    if (i % 2 != 0):
        if (S[i] == 'R'):
            can = False
            break
    else:
        if (S[i] == 'L'):
            can = False
            break
if (can):
    print("Yes")
else:
    print("No")

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

Solution (Python):

S = list(input())
def oddschange(s):
    if s == 'L':
        return 0
    else:
        return 1
def evenchange(s):
    if s == 'R':
        return 0
    else:
        return 1
ans = 1
for i,s in enumerate(S):
    if i %2 == 0:
        ans *= oddschange(s)
    else:
        ans *= evenchange(s)
print('Yes') if ans else print('No')

Solution (Python):
S = input()
N = len(S)
flag = True
for i in range(N//2):
  if S[2*i] == 'L':
    flag = False
  if S[2*i+1] == 'R':
    flag = False
    
if N%2 == 1 and S[N-1] =='L':
    flag = False
    
if (flag):
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()

flg = True

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

Solution (Python):
import sys

s = input()
kisu = ['R','U','D']
gusu = ['L','U','D']
for i in range(len(s)):
    if(i%2==0):
        if not(s[i] in kisu):
            print('No')
            sys.exit()
    else:
        if not(s[i] in gusu):
            print('No')
            sys.exit()
print('Yes')

Solution (Python):
a = input()
if len(a)==1 and a == "L":
    print("No")
    exit()
elif len(a)==1:
    print("Yes")
    exit()
for i in a[::2]:
    for j in a[1::2]:
        if i =="L" or j =="R":
            print("No")
            exit()
else:
    print("Yes")

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

odd = [s[i] for i in range(0, len(s), 2)]
even = [s[i] for i in range(1, len(s), 2)]


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

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

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

Solution (Python):


S = input()

flag = True

for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            flag = False
            break
    else:
        if S[i] == "R":
            flag = False
            break

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

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

Solution (Python):
*D, = [s.split() for s in open(0)]
D = D[0][0]
flag = 0
for i in range(len(D)):
    if (i + 1) % 2 == 0:
        if not D[i] in ["L", "U", "D"]:
            flag += 1
            break
    else:
        if not D[i] in ["R", "U", "D"]:
            flag += 1
            break
if flag:
    print("No")
else:
    print("Yes")

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

n = len(s)
a = True
odd = ['R','U','D']
even = ['L','U','D']

m = n // 2
if n == 1:
    if s in odd:
        print('Yes')
    else:
        print('No')
else:
    if all((s[2 * i] in odd) for i in range(m)):
        if all(((s[2 * i + 1]) in even) for i in range(m)):
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Solution (Python):



S = list(str(input()))
O = ['R', 'U', 'D']
E = ['L', 'U', 'D']

for i in range(len(S)):
    if (i + 1) % 2 != 0:
        if O.count(S[i]) == 0:
            print('No')
            break
    else:
        if E.count(S[i]) == 0:
            print('No')
            break
else:
    print('Yes')

Solution (Python):
s=input()
flg=0
i=0

while i<len(s):
	if (i%2==0 and s[i]=="L") or i%2!=0 and s[i]=="R":
		flg=1
		break
	i+=1
	
if flg==0:
	print("Yes")
else:
	print("No")

Solution (Python):
S = input()

Slis = list(S)

SLEN = len(Slis)

ans = 0

for i in range(SLEN):
    if i % 2 == 0 and (Slis[i] == "R" or Slis[i] == "U" or Slis[i] == "D"):
        continue
    elif i % 2  == 1 and (Slis[i] == "L" or Slis[i] == "U" or Slis[i] == "D"):
        continue
    else:
        ans = ans + 1

if ans == 0:
    print("Yes")
else:
    print("No")

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

Solution (Python):
S=input()
print(("Yes","No")[S[::2].find("L")>=0 or S[1::2].find("R")>=0])

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

Solution (Python):
S = input()

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

count = 0
for i in range(len(S)):
    if (i+1)%2 == 1 and S[i] in odd:
        count += 1
    elif (i+1)%2 == 0 and S[i] in even:
        count += 1

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

Solution (Python):
S=input()

count_even=0
count_odd=0

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

for i in range(len(S)):
    if (i+1)%2==0:
        if(S[i] in even):
            count_even+=1
    else:
        if(S[i] in odd):
            count_odd+=1

if(count_odd + count_even == len(S)):
    print('Yes')
else:
    print('No')

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

Solution (Python):
S = input()

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

flg = 0
for i in range(len(S)):
    if i % 2 == 1:
        if not S[i] in even:
            flg = 1
    else:
        if not S[i] in odd:
            flg = 1

print("Yes" if flg ==0 else "No")

Solution (Python):

S = list(input())
S.insert(0, None)
ans = "Yes"

for i in range(1, len(S)):
    if i % 2 == 1:
        if S[i] == "L":
            ans = "No"
            break
    else:
        if S[i] == "R":
            ans = "No"
            break
print(ans)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    s = input()
    if 'L' not in s[::2] and 'R' not in s[1::2]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Solution (Python):
S = input()

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

flag = "Yes"

for i in range(len(S)):
    if i % 2:
        if S[i] not in even:
            flag = "No"
            break
    else:
        if S[i] not in odd:
            flag = "No"
            break
print(flag)

Solution (Python):
import sys

alf = list(str(input()))
for index1 in range(0,len(alf),2):
	if alf[index1]=="L":
		print("No")
		sys.exit()
for index1 in range(1,len(alf),2):
	if alf[index1]=="R":
		print("No")
		sys.exit()
print("Yes")

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

Solution (Python):
S = input()
flag = True
cnt = 1
for i in S:
    if cnt % 2 != 0:
        if i != "R" and i != "U" and i != "D":
            flag = False
            break
    else:
        if i != "L" and i != "U" and i != "D":
            flag = False
            break
    cnt += 1
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):

s = input()
for i in range(len(s)):
    if s[i] != 'U' and s[i] != 'D':
        if (i+1)%2 == 0 and s[i] == 'R':
            print("No")
            exit(0)
        if (i+1)%2 != 0 and s[i] == 'L':
            print("No")
            exit(0)
print("Yes")

Solution (Python):
s=input()
n=len(s)
ans="Yes"
for i in range(1,len(s)+1):
    if i%2==0:
        if s[i-1]=='R':
            ans="No"
    elif i%2==1:
        if s[i-1]=='L':
            ans="No"
print(ans)

Solution (Python):
s=input()
for i in range(len(s)):
  if ((i%2 and s[i]=="R")
     or (not i%2 and s[i]=="L")):
    print("No")
    break
  elif i == len(s)-1:
    print("Yes")

Solution (Python):
S = input()
flag = 0
for i in range(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):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str):
    odd = ""
    even = ""
    for i in range(len(S)):
        if i % 2 == 0:
            odd += S[i]
        else:
            even += S[i]
    alloddok = "L" not in odd
    allevenok = "R" not in even
    if allevenok and alloddok:
        print(YES)
    else:
        print(NO)
    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()

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

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

Solution (Python):
S=list(input())
flag = True
for i in range(len(S)):
  s = S[i]
  if (i+1)%2==0:
    if s=="R":
      flag = False
  else:
    if s=="L":
      flag = False

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

Solution (Python):
a=input()
b=set(a[::2])
c=set(a[1::2])
b=b-{'R', 'U', 'D'}
c=c-{'L', 'U', 'D'}
if b==set() and c==set():
  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
    else:
        if S[i]=='R':
            cnt+=1
if cnt==0:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()

odd='R'
even='L'

for i, item in enumerate(s):
    if (i+1) % 2 == 0:
        if item == 'R':
            print('No')
            break
    else:
        if item == 'L':
            print('No')
            break
else:
    print('Yes')

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

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

if __name__ == "__main__":
    main()

Solution (Python):
s = input()

for i in range(len(s)):
    
    
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        exit()
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        exit()

print('Yes')

Solution (Python):
S = input()
ans = "Yes"
for s in S[::2]:
    if s == "L":
        ans = "No"
        break
for s in S[1::2]:
    if s == "R":
        ans = "No"
        break
print(ans)

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

good_o = ['R', 'U', 'D']
good_e = ['L', 'U', 'D']

ans = 'No'
for i, Si in enumerate(S):
    if i % 2 == 0:
        if Si not in good_o: break
    else:
        if Si not in good_e: break
else:
    ans = 'Yes'

print(ans)

Solution (Python):
s = input()

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

flag = True

for i in range(len(s)):
    if i % 2 == 0:
        if not s[i] in odd:
            flag = False
    else:
        if not s[i] in even:
            flag = False

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

Solution (Python):
import re

s = [i for i in input()]
flg = True
for i in range(len(s)):
  if i % 2 == 0 and re.match(r'L',s[i]):
    flg = False
  elif i % 2 != 0 and re.match(r'R',s[i]):
    flg = False
print("Yes" if flg else "No")

Solution (Python):
N=list(input())
a=[]
b=[]


for k in range(len(N)):
    if k%2>0:
        b.append(N[k])
    else:
        a.append(N[k])
if   a.count('L')==0 and b.count('R')==0:
    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] == "L":
            print("No")
            sys.exit()
    else:
        if S[i] == "R":
            print("No")
            sys.exit()
            
print("Yes")