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 = input()
L = len(S)
for i in range(1,L,2):
    if S[i] == 'L' or S[i]=='U' or S[i]=='D':
        pass
    else:
        print('No')
        exit()

for j in range(0,L,2):
    if S[j]=='R' or S[j]=='U' or S[j]=='D':
        pass
    else:
        print('No')
        exit()
print('Yes')

Solution (Python):
S = list(input())
result = True
for i in range(len(S)):
  if (i+1) % 2 == 0:
    if S[i] == 'R':
      result = False
      break
  elif (i+1) % 2 != 0:
    if S[i] == 'L':
      result = False
      break
print('Yes' if result else 'No')

Solution (Python):
from sys import exit

s = input()

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

Solution (Python):


s = list(str(input()))


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

Solution (Python):
S = input()

cnt =0
for i in range(len(S)):
    if i%2==0 and S[i] in ['R','U','D']:
        cnt+=1
    elif i%2!=0 and S[i] in ['L','U','D']:
        cnt+=1
if cnt==len(S):
    print('Yes')
else:
    print('No')

Solution (Python):
s = input().rstrip()

r = 'Yes'
for i in range(len(s)):
	if (i + 1) % 2 == 0:
		if s[i] in 'LUD':
			pass
		else:
			r = 'No'
	else:
		if s[i] in 'RUD':
			pass
		else:
			r = 'No'

	if r != 'Yes':
		break

print(r)

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')
    break
else:
  print('Yes')

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

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

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

Solution (Python):
S = str(input())
 
for i in range((len(S)+1)//2):
  if S[2*i] == 'R' or S[2*i] == 'U' or S[2*i] == 'D':
    pass
  else:
    print('No')
    exit()

for j in range(len(S)//2):
  if S[2*j+1] == 'L' or S[2*j+1] == 'U' or S[2*j+1] == 'D':
    pass
  else:
    print('No')
    exit()

print('Yes')

Solution (Python):
s=list(input())
"""
    奇数文字目がすべて R, U, D のいずれか。
    偶数文字目がすべて L, U, D のいずれか。
"""
for ii in range(len(s)):
  if ii%2==0 and s[ii]=="L":
    print("No")
    exit()
  if ii%2==1 and s[ii]=="R":
    print("No")
    exit()    
print("Yes")

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

Solution (Python):
S = 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):

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+=0
        else:
            count+=1
    else:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            count+=0
        else:
            count+=1
           
if count==0:
    print("Yes")
else:
    print("No")

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

for i in range(0,len(S)):
  if i%2 == 0:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      flag = flag+1
  elif i%2 == 1:
    if S[i] != "L" and S[i] != "U" and S[i] != "D":
      flag = flag+1
if flag == 0:
  print("Yes")
else:
  print("No")

Solution (Python):

S = input()


fl = True
for i, s in enumerate(S):
    if (
            ((i + 1) % 2 == 0 and s not in ["L", "U", "D"]) or
            ((i + 1) % 2 == 1 and s not in ["R", "U", "D"])
    ):
        fl = False
        break
        
if fl is True:
    print("Yes")
else:
    print("No")

Solution (Python):

"""
Created on Thu May 14 23:42:46 2020

@author: Kanaru Sato
"""

s = list(input())
Noflag = 0

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

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

Solution (Python):
s = input()

for i in range(len(s)):
  if i % 2 == 0 and s[i] != "L":
    continue
  elif i % 2 != 0 and s[i] != "R":
    continue
  else:
    print("No")
    break
else:
  print("Yes")

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

Solution (Python):
import sys

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

print('Yes')

Solution (Python):
S=input()

i=0
while i<len(S):
    if (i+1)%2==0:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            pass
        else:
            print("No")
            quit()
    else:
        if S[i]=="R" or S[i]=="U" or S[i]=="D":
            pass
        else:
            print("No")
            quit()
    i+=1
    
print("Yes")

Solution (Python):
import itertools
import math
import fractions
import functools
s = input()
for i in range(len(s)):
    if i % 2 == 0:
        if not(s[i] == "R" or s[i] == "U" or s[i]=="D"):
            print("No")
            quit()
    else:
        if not(s[i] == "L" or s[i] == "U" or s[i]=="D"):
            print("No")
            quit()
print("Yes")

Solution (Python):

s =input()
odd=["R","U","D"]
even=["L","U","D"]
cnt=0
for i in range(len(s)):
    if i%2==0:
        if s[i] in odd:
            cnt+=1
    else:
        if s[i] in even:
            cnt+=1
if cnt==len(s):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
easy = True
sr = S[::2]
sl = S[1::2]
if 'L' in sr: easy = False
if 'R' in sl: easy = False
if easy:
    print('Yes')
else:
    print('No')

Solution (Python):

s = input()

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

Solution (Python):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]=='L'):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")

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

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

def judge():
    for i in range(len(s)):
        if i%2==0 and s[i] not in a:
            return False
        if i%2==1 and s[i] not in b:
            return False
    return True

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

Solution (Python):
import os, sys, re, math

S = input()

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

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

Solution (Python):
S = input()

tap_flag = True
for i in range(len(S)):
    if (i+1) % 2 == 0:
        if S[i] == "R":
            tap_flag = False
            break
    elif (i+1) % 2 == 1:
        if S[i] == "L":
            tap_flag = False
            break

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

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):
ss = input()
easy = True
tap = [['R', 'U', 'D'], ['L', 'U', 'D']]
for i, s in enumerate(ss):
	if s not in tap[i % 2]:
		easy = False
print ('Yes' if easy else 'No')

Solution (Python):
S = input()
count = 0
for idx, s in enumerate(S):
    if (idx + 1) % 2:
        count += s in ['R', 'U', 'D']
    else:
        count += s in ['L', 'U', 'D']

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

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

Solution (Python):


s = input()
odd = 'RUD'
even = 'LUD'
ans = 'Yes'
for i in range(len(s)):
    c = s[i]
    if (i+1) % 2 != 0:
        if c == 'L':
            ans = 'No'
    else:
        if c == 'R':
            ans = 'No'
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()

for i, alp in enumerate(S):
    if i % 2 != 0 and alp == "R":
        print("No")
        exit(0)
    if i % 2 == 0 and alp == "L":
        print("No")
        exit(0)
print("Yes")

Solution (Python):
S = input()
odd = S[0::2]
even = S[1::2]
ans = 'No'

if 'L' not in odd:
    if 'R' not in even:
        ans = 'Yes'

print(ans)

Solution (Python):
import sys

S = list(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')

Solution (Python):
s=input()
for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    print('No')
    break
  elif i%2==1 and s[i]=='R':
    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] =="R" or s[i] =="U" or s[i] =="D":
      count += 1
  else:
    if s[i] =="L" or s[i] =="U" or s[i] =="D":
      count += 1

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

Solution (Python):
import sys

s = list(input())
n = len(s)
for i in range(n):
    if (i+1)%2 ==0:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            print('No')
            sys.exit()
    else:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            print('No')
            sys.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()

answer = 'Yes'

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

Solution (Python):
S=input()
for id,x in enumerate(S):
  if id % 2 == 0:
    if (x not in ["R","U","D"]):
      print("No")
      break
  if id % 2 == 1:
    if (x not in ["L","U","D"]):
      print("No")
      break
else:
  print("Yes")

Solution (Python):


s = input()
if len(set(s[0::2]) - set(['R', 'U', 'D'])) == 0 and\
    len(set(s[1::2]) - set(['L', 'U', 'D'])) == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
from itertools import cycle

bad = cycle('LR')

for c in input():
    if c == next(bad):
        print('No')
        break
else:
    print('Yes')

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

Solution (Python):
s=input()
n=len(s)
k=['R','U','D']
g=['L','U','D']
for i in range(n):
  if (i+1)%2!=0 and s[i] not in k:
    print('No')
    exit()
  elif (i+1)%2==0 and s[i] not in g:
    print('No')
    exit()
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):
S = input()
even = S[::2]
odd = S[1::2]
if "L" in even or "R" in odd:
    print("No")
else:
    print("Yes")

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

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

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

Solution (Python):
import sys
s = input()
a = 'R U D'
b = 'L U D'
for i, num in enumerate(s):
  if i % 2==0:
    if num in a:
      continue
    else:
      print('No')
      sys.exit()
  else:
    if num in b:
      continue
    else:
      print('No')
      sys.exit()
print('Yes')

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

Solution (Python):
import sys

s = input()
text1 = 'R U D'
text2 = 'L U D'

for i, num in enumerate(s):
  if(i % 2 == 0):
    if(num in text1):
      continue
    else:
      print('No')
      sys.exit()
  else:
    if(num in text2):
      continue
    else:
      print('No')
      sys.exit()

print('Yes')

Solution (Python):
s = input()

s1 = s[::2]
s2 = s[1::2]
if "L" in s1:
    print("No")
elif "R" in s2:
    print("No")
else:
    print("Yes")

Solution (Python):
S = list(input())
odds = S[0::2]
evens = S[1::2]

good_odd = ['R', 'U', 'D']
good_even = ['L', 'U', 'D']

for odd in odds:
    if odd in good_odd:
        pass
    else:
        print('No')
        exit()
for even in evens:
    if even in good_even:
        pass
    else:
        print('No')
        exit()
print('Yes')

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

Solution (Python):
import sys
s = input()
lst1 = list(s[::2])
lst2 = list(s[1::2])
for i in lst1:
    if i ==  "R" or i== "U" or i== "D":
        a = "Yes"
    else:
         a = "No"
         print(a)
         sys.exit()
for j in lst2:
    if j ==  "L" or j== "U" or j== "D":
        a = "Yes"
    else:
        a = "No"
        print(a)
        sys.exit()
print(a)

Solution (Python):
s=input()
n=0
for i in range(len(s)):
        if 2*i<=len(s)-1: 
            if s[2*i]=="R" or s[2*i]=="U" or s[2*i]=="D":n+=1
for i in range(len(s)):
        if 2*i+1<=len(s)-1:
            if s[2*i+1]=="L" or s[2*i+1]=="U" or s[2*i+1]=="D":n+=1
print("Yes" if n==len(s) else "No")

Solution (Python):
s = input()
cnt = 0
for i in range(1, len(s)+1):
    t = s[i-1]
    if i % 2 == 1:
        if t == 'R':
            cnt += 1
        elif t == 'U':
            cnt += 1
        elif t == 'D':
            cnt += 1
    else:
        if t == 'L':
            cnt += 1
        elif t == 'U':
            cnt += 1
        elif t == 'D':
            cnt += 1


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

Solution (Python):
S = input()
O = ['R','U','D']
E = ['L','U','D']
ans = 'Yes'
for i in range(len(S)):
    if ((i+1)%2 != 0) and (S[i] not in O):
        ans = 'No'
    elif ((i+1)%2 == 0) and (S[i] not in E):
        ans = 'No'
print(ans)

Solution (Python):





s = input()

ok = True

for i, c in enumerate(s):
    if i & 1 == 0:
        if c == "L":
            ok = False
            break
    else:
        if c == "R":
            ok = False
            break

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

Solution (Python):
s = input()
print("Yes" if all((s[i] in "RUD" and i%2==0) or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
odd = ["R","U","D"]
even = ["L","U","D"]
s = input()
for i in range(len(s)):
  if i%2 == 0:
    if s[i] not in odd:
      print("No")
      exit()
  elif i%2 == 1:
    if s[i] not in even:
      print("No")
      exit()
print("Yes")

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

Solution (Python):
s = input()
n = len(s)
flag = 1
for i in range(n):
    if (i % 2 == 0) and (s[i] not in {'R', 'U', 'D'}):
        flag = 0
    if (i % 2 == 1) and (s[i] not in {'L', 'U', 'D'}):
        flag = 0
print('Yes' if flag else 'No')

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

Solution (Python):
s = input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce


import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


s = S()
n = len(s)

for i in range(n):
    if i % 2 == 0 and not s[i] in "RUD":
        print("No")
        exit()
    elif i % 2 == 1 and not s[i] in "LUD":
        print("No")
        exit()

print("Yes")

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

Solution (Python):
s = input()
k = ['R', 'U', 'D']
g = ['L', 'U', 'D']
k_count = 0
g_count = 0
kisuu = 0
guusuu = 0
for i in range(0, len(s)):
  if i%2 != 0:
    guusuu += 1
    if (s[i] in g) == True:
      g_count += 1
  if i%2 == 0:
    kisuu += 1
    if (s[i] in k) == True:
      k_count += 1
if kisuu == k_count and guusuu == g_count:
  print('Yes')
else:
  print('No')

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    s = input()
    ans = solve(s)
    print(ans)


def solve(s):
    if not all([(c in ['R', 'U', 'D']) for c in s[::2]]):
        return 'No'
    if not all([c in ['L', 'U', 'D'] for c in s[1::2]]):
        return 'No'
    return 'Yes'


if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

x = len(s)

cnt = 1

ans = 0

for i in s:
    if cnt == 1:
        cnt = 0
        if i != "L":
            ans += 1
    else:
        cnt = 1
        if i != "R":
            ans += 1

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

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

for i, s in enumerate(S):
    if i%2==0:
        if s not in ["R", "U", "D"]:
            print("No")
            sys.exit()
    else:
        if s not in ["L", "U", "D"]:
            print("No")
            sys.exit()

print("Yes")

Solution (Python):
S=list(input())
a=S[::2]
b='Yes'
for i in a:
  if i!='R' and i!='U' and i!='D':
    b='No'
    break
c=S[1::2]
for j in c:
  if j!='L' and j!='U' and j!='D':
    b='No'
    break
print(b)

Solution (Python):
s = input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
s = input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
s = input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
s=input();print("YNeos"['L'in s[0::2]or'R'in s[1::2]::2])

Solution (Python):


S = str(input())
ans = 'Yes'
for i in range(1, len(S) + 1):
    if i % 2 != 0 and S[i - 1] == 'L':
        ans = 'No'
    if i % 2 == 0 and S[i - 1] == 'R':
        ans = 'No'

print(ans)

Solution (Python):
S = input()
flg = 0
for i,s in enumerate(S):
    if i % 2 == 0:
        if s == 'L':
            flg = 1
    else:
        if s == 'R':
            flg = 1

if flg == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
def LILI(n): return [LI() for _ in range(n)]
INF = 10 ** 18
MOD = 10 ** 9 + 7

def main_1(): 
    text = (['Sunny', 'Cloudy'], ['Cloudy', 'Rainy'],['Rainy','Sunny'])
    s = SI()
    for i in text:
        if s == i[0]:
            print(i[1])

def main(): 
    s = SI()
    for num, i in enumerate(s):
        if num % 2 == 1: 
            if not (i in 'LUD'):
                print('No')
                return
        else:
            if not (i in 'RUD'):
                print('No')
                return
    print('Yes')

main()

Solution (Python):

S = input()

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

Solution (Python):
s = list(input())
for i in range(len(s)):
    if i%2==0:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            s[i] = '*'
    else:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            s[i] = '*'
print(['No','Yes'][set(s)=={'*'}])

Solution (Python):
S =input()

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

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

ans = 'Yes'
isOdd = True
for i in range(l):
    if isOdd:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            isOdd = False
            continue
        else:
            ans = 'No'
            break
    else:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            isOdd = True
            continue
        else:
            ans = 'No'
            break

print(ans)

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


for i in S[0::2]:
    if i!="R" and i!="U" and i!="D":
        print("No")
        sys.exit()
for i in S[1::2]:
    if i!="L" and i!="U" and i!="D":
        print("No")
        sys.exit()
print("Yes")

Solution (Python):
odd = set(['R','U','D'])
even = set(['L','U','D'])
s = input()
ans = 'Yes'
for i,v in enumerate(s):
  if i % 2 != 0 and v not in even:
    ans = 'No'
    break
  elif i % 2 == 0 and v not in odd:
    ans = 'No'
    break

print(ans)

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

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

for i, s in enumerate(S):
    if (i + 1) % 2 == 1 and (s not in odd):
        print("No")
        exit()
    if (i + 1) % 2 == 0 and (s not in even):
        print("No")
        exit()

print("Yes")

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

for i in range(len(s)):

    if i%2==1:
        if s[i] not in even:
            flag = False
            break

    elif i%2==0:
        if s[i] not in odd:
            flag = False
            break

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

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

odd = [S[i] for i in range(len(S)) if i%2==0]

even = [S[i] for i in range(len(S)) if i%2!=0]

flg=0
for s in odd:
    if s=='R' or s=='U' or s=='D':
        flg+=0
    else:
        flg+=1

for s in even:
    if s=='L' or s=='U' or s=='D':
        flg+=0
    else:
        flg+=1

if flg !=0:
    print('No')
else:
    print('Yes')

Solution (Python):
s = str(input())
tf = True
for i,letter in enumerate(s):
  if (i) % 2 == 0:
    if letter not in ['R','U','D']:
      tf = False
  if (i) % 2 == 1:
    if letter not in ['L','U','D']:
      tf = False
if tf:
  print('Yes')
else:
  print('No')

Solution (Python):
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
S = list(input())
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):
a=input()

if set(a[0::2])<=set(['R','U','D']) and set(a[1::2])<=set(['L','U','D']):
  print('Yes')
else:
  print('No')

Solution (Python):
S=input()
n=0
for i in S:
    if (n%2==0 and i=="L") or (n%2==1 and i=="R"):
        print('No')
        exit()
    n+=1

print('Yes')

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

Solution (Python):
S = input()

o = set(list(S[::2]))
e = set(list(S[1::2]))

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

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

O = [S[i] for i in range(len(S)) if i % 2 == 0]
E = [S[i] for i in range(len(S)) if i % 2 == 1]

if "L" in O or "R" in E:
  print("No")
else:
  print("Yes")

Solution (Python):
S = list(input())
ans = 0
odd = []
even = []

i = 0
while i < len(S):
  odd.append(S[i])
  i += 2
    
j = 1
while j < len(S):
  even.append(S[j])
  j += 2
    
if ('L' not in odd) and ('R' not in even):
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
s = input()


def func(s):
    for i in range(len(s)):
        if(i % 2 != 0 and s[i] == 'R'):
            print('No')
            return
        if(i % 2 != 1 and s[i] == 'L'):
            print("No")
            return
    print("Yes")
    return


func(s)

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

Solution (Python):
def tapdance(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
                return 'No'
        else:
            if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
                return 'No'
    return 'Yes'
s = input()
print(tapdance(s))

Solution (Python):
S = input()
E = ["R","U","D"]
O = ["L","U","D"]
for i in range (len(S)):
  if i%2==0:
    if S[i] in E:
      continue
    else:
      print("No")
      quit()
  else:
    if S[i] in O:
      continue
    else:
      print("No")
      quit()
print("Yes")

Solution (Python):
o="RUD"
g="LUD"

s=input()

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

Solution (Python):
S = input()

a = len(S)
ans = "Yes"
for i in range(0, a, 2):
    if S[i] == "L":
        ans = "No"
for i in range(1, a, 2):
    if S[i] == "R":
        ans = "No"
print(ans)

Solution (Python):

s=list(input())

odd=s[0::2]
even=s[1::2]
set_o=set(odd)
set_e=set(even)
if set_o<=set('RUD') and set_e<=set('LUD'):
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
ss=len(s)
c=0

for i in range(0,ss//2):
  if s[2*i]=="R"or s[2*i]=="U"or s[2*i]=="D":
    c=c+1
  if s[2*i+1]=="L"or s[2*i+1]=="U"or s[2*i+1]=="D":
    c=c+1
    
if ss%2==0:
  if c==ss:
    print("Yes")
  else:
    print("No")
else:
  if c==ss-1 and (s[-1]=="R"or s[-1]=="U"or s[-1]=="D"):
    print("Yes")
  else:
    print("No")

Solution (Python):
s = input()
odds = [s[i] for i in range(len(s)) if i % 2 == 0]
evens = [s[i] for i in range(len(s)) if  i % 2 == 1]
if odds.count('L') > 0:
  print('No')
elif evens.count('R') > 0:
  print('No')
else:
  print('Yes')

Solution (Python):
S = input()

kisu = S[0::2]
gusu = S[1::2]
kisu = kisu.replace("R", "")
kisu = kisu.replace("U", "")
kisu = kisu.replace("D", "")
gusu = gusu.replace("L", "")
gusu = gusu.replace("U", "")
gusu = gusu.replace("D", "")

if len(kisu) == len(gusu) == 0:
    print("Yes")
else:
    print("No")

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