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()
N = len(S)
hantei = [False]*N
check = True
for i in range(1, N+1):
    if i % 2 :
        if (S[i-1] == "R") | (S[i-1] == "U") | (S[i-1] == "D") :
            hantei[i-1] = True
        else:
            hantei[i-1] = False
    else:
        if (S[i-1] == "L") | (S[i-1] == "U") | (S[i-1] == "D") :
            hantei[i-1] = True
        else:
            hantei[i-1] = False

for i in range(N):
    if hantei[i] == False:
        check = False
            
if check :
    print('Yes')
else:
    print('No')

Solution (Python):

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

print(ans)

Solution (Python):
S = input()

ans = "Yes"

for i in range(len(S)):
    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()
n = len(s)
rlist = ["R", "U", "D"]
llist = ["L", "U", "D"]
for i in range(n):
  if i % 2 == 0 and s[i] in rlist:
    continue
  elif i % 2 == 1 and s[i] in llist:
    continue
  else:
    print("No")
    exit()
print("Yes")

Solution (Python):
import sys
S=list(input())
a=S[0::2]
b=S[1::2]


A=['R','U','D']
B=['L','U','D']
for i in a:
    if i in A:
        continue
    else:
        print('No')
        sys.exit()
for i in b:
    if i in B:
        continue
    else:
        print('No')
        sys.exit()
else:
    print('Yes')

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

Solution (Python):

s = input()


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

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

str_data = list(S)

jdg_flag = 0

for i in range(0,len(str_data),2):
  if str_data[i] == 'L':
    jdg_flag = 1
    
for i in range(1,len(str_data),2):
  if str_data[i] == 'R':
    jdg_flag = 1
    
if jdg_flag == 0:
  out = 'Yes'
else:
  out = 'No'

  
print(out)

Solution (Python):
dance = input()
dance1 = [i for i in dance]
check_n = 0
for j in range(len(dance1)):
    if(j%2==0):
        if((dance1[j]=="L")):
            check_n = 1
            break
    else:
        if((dance1[j]=="R")):
            check_n = 1
            break

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

Solution (Python):
S = input()
  
judge = 'Yes'
count = 1
for item in S:
  if count % 2 == 1:
    if item == 'L':
      judge = 'No'
      break;
  if count % 2 == 0:
    if item == 'R':
      judge = 'No'
      break;

  count += 1

print(judge)

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


odd = S[0::2]


even = S[1::2]

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

Solution (Python):
s = input()
flag = True
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')

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

Solution (Python):
while True:
    try:
        S = input()
        for i, j in enumerate(S):
            if i % 2 == 1:
                if j != 'L' and j != 'U' and j != 'D':
                    print("No")
                    break
            else:
                if j != 'R' and j != 'U' and j != 'D':
                    print("No")
                    break
        else:
            print("Yes")
    except EOFError:
        break

Solution (Python):
s = list(input())
kisu = True
res = "Yes"
for ss in s:
    if kisu:
        if ss == "L":
            res = "No"
            break
        kisu = False
    else:
        if ss == "R":
            res = "No"
            break
        kisu = True
print(res)

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

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

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

a = [1]
for i in range(len(s)):
	k = i % 2
	if k ==0:
		if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
			a.append(1)
		else:
			a.append(0)
	else:
		if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
			a.append(1)
		else:
			a.append(0)

if min(a) == 0:
	ans = 'No'
else:
	ans = 'Yes'

print(ans)

Solution (Python):
s=list(input())
a = 0
for i,S in enumerate(s):
    if i%2 ==0:
        if (S != "R") and (S != "U") and (S != "D"):
            break
    else:
        if (S != "L") and (S != "U") and (S != "D"):
            break
else:
    a = 1
    
if a == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
a="RUD"
b="LUD"
print("Yes" if sum([i in a for i in s[0::2]])==len(s)//2+len(s)%2 and sum([i in b for i in s[1::2]])==len(s)//2 else "No")

Solution (Python):
s = str(input())
ans = 'Yes'
for i in list(s)[0::2]:
    if i == 'L':
        ans = 'No'
for i in list(s)[1::2]:
    if i == 'R':
        ans = 'No'
print(ans)

Solution (Python):
import sys

def read():
	return sys.stdin.readline().rstrip()

S = read()
Odd = S[0::2]
Even = S[1::2]

if ("L" not in Odd) and ("R" not in Even):
  print("Yes")
else:
  print("No")

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

Solution (Python):





from sys import stdin,setrecursionlimit


setrecursionlimit(10**6)
input=stdin.readline

s=input().rstrip()
g=s[1::2]
k=s[0::2]
if "L" in k or "R" in g:
    print("No")
else:
    print("Yes")

Solution (Python):
import sys

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

print('Yes')

Solution (Python):



def main():
    S = input()

    y = "Yes"
    n = "No"

    rud = ["R", "U", "D"]
    lud = ["L", "U", "D"]
    for i, s in enumerate(S):
        j = i + 1
        if j % 2 == 1:
            if s not in rud:
                return n
        else:
            if s not in lud:
                return n

    return y


if __name__ == "__main__":
    print(main())

Solution (Python):
s_s = list(input())
odd  = set(['R', 'U', 'D'])
even = set(['L', 'U', 'D'])
ans = 'Yes'
for i, s in zip(range(1, len(s_s) + 1), s_s):
  if (i % 2 == 0 and s not in even) or (i % 2 == 1 and s not in odd):
      ans = 'No'
      break
print(ans)

Solution (Python):
import sys


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


def main():
    S = input()

    odd = True
    for x in S:
        chars = 'RUD' if odd else 'LUD'
        if x not in chars:
            print('No')
            return
        odd = not odd
    print('Yes')


if __name__ == "__main__":
    main()

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

Solution (Python):
s = list(input())
ch = ('L','R')
c = 1
ans = "Yes"
for i in s:
    if i == ch[min(0,c)]:
        ans = "No"
    c *= -1
print(ans)

Solution (Python):
s = input()

for index, step in enumerate(s):
    if index % 2 == 0 and step == "L":
        print('No')
        exit()
    if index % 2 == 1 and step == "R":
        print('No')
        exit()
print('Yes')

Solution (Python):
s = input()

fizz = list()
buzz = list()
for i in range(1, len(s) + 1):
    if i % 2 == 0:
        fizz.append(s[i-1])
    else:
        buzz.append(s[i-1])

boolean = 0
for i in range(len(fizz)):
    if fizz[i] == "R":
        print("No")
        boolean = 1
        break
if boolean != 1:
    for i in range(len(buzz)):
        if buzz[i] == "L":
            print("No")
            boolean = 1
            break

if boolean == 0:
    print("Yes")

Solution (Python):

from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    kisuu = ['R','U','D']
    guusuu = ['L','U','D']
    flag = True
    
    s = input()
    for e,i in enumerate(s):
        if not e % 2:
            if not i in kisuu:
                flag = False
        else:
            if not i in guusuu:
                flag = False
    if flag:
        print('Yes')
    else:
        print('No')




main()

Solution (Python):
S = input()

odd = True
yes = True

for s in S:
    if odd:
        if s == "L":
            yes = False
            break
        odd = False
    else:
        if s == "R":
            yes = False
            break
        odd = True



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

Solution (Python):
import sys
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):
s = input()


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

Solution (Python):
s = input()
f = 1
for i in range(0, len(s), 2):
	if s[i] not in ['R', 'U', 'D']:
		f = 0
		break

for i in range(1, len(s), 2):
	if s[i] not in ['L', 'U', 'D']:
		f = 0
		break

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

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

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

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

Solution (Python):
s=input()
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
  else:
    if s[i]!='L' and s[i]!='U' and s[i]!='D':
      flg=1
      break
if flg==0:
  print("Yes")
else:
  print("No")

Solution (Python):
ss =  input()

ans = "Yes"
r = ["R", "U", "D"]
l = ["L", "U", "D"]

for i, s in enumerate(ss):
  if (i+1) % 2 == 0 and s in l:
    continue
  if (i+1) % 2 == 1 and s in r:
    continue
  ans = "No"
    
print(ans)

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

Solution (Python):


s = input().strip()

good_odds = list('RUD')
good_evens = list('LUD')

odd_s = s[::2]
even_s = s[1::2]

for c in odd_s:
    if c not in good_odds:
        print("No")
        exit()


for c in even_s:
    if c not in good_evens:
        print("No")
        exit()


print("Yes")

Solution (Python):
s = input()

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

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

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

Solution (Python):






s = input()

char_list = list(s)
count = 0
result = True


for char in char_list:
    count += 1
    
    if count % 2 == 0:
        if char == "R":
            
            result = False
    else:
        if char == "L":
            
            result = False



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

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

Solution (Python):

S = input()

count = 1
yesFlag = True
for s in S:
    if count % 2 == 1:
        count += 1
        if s == 'L':
            yesFlag = False
            break
    else:
        count += 1
        if s == 'R':
            yesFlag = False
            break

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

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

s = list(input())
ans = 'Yes'

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


print(ans)

Solution (Python):
import sys
s = input()
odd = s[::2]
even = s[1::2]
for _ in odd:
  if _ != 'R':
    if _ != 'U':
      if _ != 'D':
        print('No')
        sys.exit()
for _ in even:
  if _ != 'L':
    if _ != 'U':
      if _ != 'D':
        print('No')
        sys.exit()
print('Yes')

Solution (Python):



S = input()

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

Solution (Python):
s = str(input())
ansor = 'Yes'

for i in range(len(s)):
    if i %2 == 0:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            ansor = 'No'
    elif i %2 == 1:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            ansor = 'No'
print(ansor)

Solution (Python):
S = input()
S_odd = S[::2]
S_even = S[1::2]

cond = True
for s in S_odd:
    if s not in ['R', 'U', 'D']:
        cond = False
        
for s in S_even:
    if s not in ['L', 'U', 'D']:
        cond = False

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

Solution (Python):
S = input()
isOdd = True
isEasy = True
for char in S:
    if isOdd:
        if (char == 'L'):
            isEasy = False
            break
    else:
        if (char == 'R'):
            isEasy = False
            break
    isOdd = not isOdd
print('Yes' if isEasy else '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):
s = input()
for i,c in enumerate(s):
  if i % 2 == 0:
    if not c in ["R","U","D"]:
      print("No")
      break
  else:
    if not c in ["L","U","D"]:
      print("No")
      break
else:
  print("Yes")

Solution (Python):
S = input()

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

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

Solution (Python):
s = list(input())
if any(map(lambda i: s[i] == "LR"[i % 2], range(len(s)))):
    ans = "No"
else:
    ans = "Yes"
print(ans)

Solution (Python):
import sys

S = input()

cnt = 0
for s in S:
    if cnt % 2 == 0:
        if s == 'L':
            print('No')
            sys.exit()
    if cnt % 2 != 0:
        if s == 'R':
            print('No')
            sys.exit()
    cnt += 1

print('Yes')

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

ans = 'Yes'
for i, step in enumerate(S):
    odd_even = (i+1) % 2
    if odd_even == 0:
        if step != 'L' and step != 'U' and step != 'D':
            ans = 'No'
            break
    elif odd_even == 1:
        if step != 'R' and step != 'U' and step != 'D':
            ans = 'No'
            break
print(ans)

Solution (Python):
S=input()

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

Solution (Python):


S = input()

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

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

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()

false_char = 'L'
easy = True

for s in S:
	if s == false_char:
		easy = False
		
		break

	if false_char == 'R':
		false_char = 'L'
	else:
		false_char ='R'

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

Solution (Python):
import sys
N = list(input())
answer = 'Yes'
for i in range(1, len(N)+1):
    if N[i-1]!='U' and N[i-1]!='D':
        if ((i-1)&1)==0:
            if N[i-1]!='R':
                answer = 'No'
                break
        else:
            if N[i-1]!='L':
                answer = 'No'
                break

print(answer)

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")
if flag == 1:print("No")

Solution (Python):
S = input()
isEven = False
for s in S:
    if isEven :
        if s == 'R':
            print('No')
            exit()
    else :
        if s == 'L':
            print('No')
            exit()
    isEven = not isEven
print('Yes')

Solution (Python):
s=input()
s1=[i for i in s[::2] if i=='R' or i=='U' or i=='D']
s2=[i for i in s[1::2] if i=='L' or i=='U' or i=='D']
if len(s1)==len(s[::2]) and len(s2)==len(s[1::2]):
  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()
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()
for o in S[::2]:
  if o not in 'RUD':
    print('No')
    exit()
for e in S[1::2]:
  if e not in 'LUD':
    print('No')
    exit()
print('Yes')

Solution (Python):

def main():
    S = list(input())
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
                print('No')
                return
        if i % 2 == 1:
            if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
                print('No')
                return
    print('Yes')


if __name__ == '__main__':
    main()

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

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

Solution (Python):







    


if __name__ == "__main__":

    Input1 = [input() for i in range(1)]
    DD = Input1[0]
    Easy = 'Yes'
    for step in range(len(DD)):
        if step % 2 == 0:
            if not DD[step] in ['R','U','D']:
                Easy = 'No'
                break
        else:
            if not DD[step] in ['L','U','D']:
                Easy = 'No'
                break
    print(Easy)

Solution (Python):
ss = input()
a = [["R", "U", "D"], ["L", "U", "D"]]
for i, v in enumerate(ss):
	if v not in a[i%2]:
		print("No")
		break
else:
	print("Yes")

Solution (Python):
S = input()
one = True
zero = True
for i in range(len(S)):
    if (i + 1) % 2 == 1:
        if S[i] not in ["R", "U","D"]:
            one = False
    else:
        if S[i] not in ["L","U","D"]:
            zero = False
if one and zero:
    print("Yes")
else:
    print("No")

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

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

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

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

inputs = input()

result = None
for i, s in enumerate(inputs):
    if (i + 1) % 2 == 0 and s in even:
        result = 'Yes'
    elif (i + 1) % 2 != 0 and s in odd:
        result = 'Yes'
    else:
        result = 'No'
        break

print(result)

Solution (Python):
s=input()
rt="Yes"
for i in s[0::2]:
  if not i in ["R","U","D"]:
    rt="No"
for i in s[1::2]:
  if not i in ["L","U","D"]:
    rt="No"
print(rt)

Solution (Python):
import sys
s = list(input())
for i in range(len(s)):
  if i%2: 
    
    if s[i] == 'R':
      print('No')
      sys.exit()
  if not i%2: 
    
    if s[i] == 'L':
      print('No')
      sys.exit()
print('Yes')

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7

def resolve():
    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")

resolve()

Solution (Python):
odd_tap = ['R', 'U', 'D']

even_tap = ['L', 'U', 'D']


def main():
    S = input()

    res = True
    for i, c in enumerate(S, start=1):
        if i % 2 == 1 and c not in odd_tap:
            res = False
            break
        elif i % 2 == 0 and c not in even_tap:
            res = False
            break

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


if __name__ == '__main__':
    main()

Solution (Python):
n = list(str(input()))
a = ["R", "U", "D"]
b = ["L", "U", "D"]

ans = "No"
aa = [True if n[i] in a else False for i in range(0, len(n), 2)]
bb = [True if n[i] in b else False for i in range(1, len(n), 2)]
if all(aa) and all(bb):
    ans = "Yes"
print(ans)

Solution (Python):
import sys
import math
from fractions import gcd





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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

s =  list(sys.stdin.readline().rstrip())
k=['R', 'U', 'D']
g=['L', 'U', 'D']

flg = 1

for i in range(len(s)):
    if (i+1)%2 !=0:
        if s[i] not in k:
            flg = 0
    if (i+1)%2 ==0:
        if s[i] not in g:
            flg = 0
if flg == 0:
    print("No")
else:
    print("Yes")

Solution (Python):
s=input()
a=s[0::2]
b=s[1::2]

if 'R' not in b and 'L' not in a:
    print('Yes')
else:
    print('No')

Solution (Python):


def ans() :
    evenStr = "LUD"
    oddStr = "RUD"

    s = input()
    flg = True
    for i in range(len(s)):
        if i % 2 == 1 and s[i] in evenStr:
            continue
        elif i % 2 == 0 and s[i] in oddStr:
            continue
        else:
            flg = False
            break

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




if __name__ == '__main__':
    ans()

Solution (Python):
s = input()
for i, c  in enumerate(s):
  if i%2==0 and c=="L":
    print("No")
    break
  elif i%2==1 and c=="R":
    print("No")
    break
  elif i == len(s)-1:
    print("Yes")

Solution (Python):
odd = {'R', 'U', 'D'}
even = {'L', 'U', 'D'}
string = input()
result = 'Yes'
for i, c in enumerate(string, start=1):
    if i % 2 == 0:
        if c not in even:
            result = 'No'
            break
    else:
        if c not in odd:
            result = 'No'
            break
print(result)

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

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

Solution (Python):
S = input()
index = 1
no_flag = True
for i in S:
    if index % 2 == 1:
        if i != 'R' and i != 'U' and i != 'D':
            no_flag = False
    else:
        if i != 'L' and i != 'U' and i != 'D':
            no_flag = False
    index += 1

if no_flag == True:
    print('Yes')
else:
    print('No')

Solution (Python):


S = input()

ok = "Yes"
for i in range(len(S)):
    if i % 2 == 1:
        if S[i] not in "LUD":
            ok = "No"
            break
    else:
        if S[i] not in "RUD":
            ok = "No"
            break

print(ok)

Solution (Python):
S = input()
S = [c for c in S]

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

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

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

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

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

X = "Yes"

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

print(X)

Solution (Python):
S = input()

ans = 'Yes'
A = ['R', 'U', 'D']
B = ['L', 'U', 'D']
for i in range(len(S)):
  if (i % 2 == 0):
    if (S[i] not in A):
      ans = 'No'
      break
  else:
    if (S[i] not in B):
      ans = 'No'
      break
print(ans)

Solution (Python):
S = input()

for s in S[::2]:
    if not s in ['R','U','D']:
        print("No")
        exit()
    
for s in S[1::2]:
    if not s in ['L','U','D']:
        print("No")
        exit()
print("Yes")

Solution (Python):
s=input()

i=0
r=1
l=1
for c in s:

  if i%2==0:
    if c=='L':
      r=0
  if i%2==1:
    if c=='R':
      l=0
  i+=1
if l==1 and r==1:
  print("Yes")
else:
  print("No")

Solution (Python):
s=input()
oddtap="RUD"
evetap="LUD"

odd=True
for c in s:
    if odd:
        if c in oddtap:
            odd=False
        else:
            print("No")
            break
    else:
        if c in evetap:
            odd=True
        else:
            print("No")
            break
else:
    print("Yes")

Solution (Python):
S = input()
ans = 'Yes'

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

Solution (Python):
lst = list(input())
r = ['R', 'U', 'D']
l = ['L', 'U', 'D']
ans = True
for i, e in enumerate(lst):
  ii = i +1
  if ii%2 == 0 and e not in l:
    ans = False
    break
  if ii%2 != 0 and e not in r:
    ans = False
    break
print('Yes' if ans else 'No')

Solution (Python):
S=input()

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

Solution (Python):
s = input()


def is_odd(num):
    if num % 2 == 0:
        return False
    else:
        return True


is_easy = True

for idx, s_i in enumerate(s):
    if is_odd(idx+1) and s_i == 'L':
        is_easy = False
        break
    elif not is_odd(idx+1) and s_i == 'R':
        is_easy = False
        break

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

Solution (Python):
import sys

def main():
    S = sys.stdin.readline()
    for i, s in enumerate(S):
        j = i+1
        if j % 2 == 1 and s == 'L' or j % 2 == 0 and s == 'R':
            print('No')
            sys.exit()
    print('Yes')

if __name__=='__main__':
    main()

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

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

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

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

ans="Yes"

ki=0
gu=0
if len(s)%2==0:
  ki=len(s)//2
  gu=len(s)//2
else:
  ki=(len(s)//2)+1
  gu=len(s)//2


for i in range(ki):
  if s[2*i] == "L":
    ans="No"

for i in range(gu):
  if s[2*i+1] == "R":
    ans="No"

print(ans)

Solution (Python):
s_in = input()
s = []
for i in range(len(s_in)):
  s.append(s_in[i])

  
flg = False
for i in range(len(s)):
    if (i+1)%2 == 0:
        if (s[i] == "L" or s[i] == "U" or s[i]  == "D"):
            flg = True
        else:
            flg = False
            break
    else:
        if (s[i] == "R" or s[i] == "U" or s[i]  == "D"):
            flg = True
        else:
            flg = False
            break
if (flg):
    print("Yes")
else:
    print("No")