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



Sample input:
RUDLUDR


Sample output:
Yes

Submission status: Accepted

Solution code:
S = input()

#奇数判定関数
def oj():
  o = "y"
  
  for i in S[0::2]:
    if i == "L":
      o = "n"
  return o
  
#偶数判定関数
def ej():
  e = "y"
  
  for i in S[1::2]:
    if i == "R":
      e = "n"
  return e
  

def j(o,e):
  if o == "y" and e == "y":
    print("Yes")
  else:
    print("No")

j(oj(),ej())

Submission status: Accepted

Solution code:
li=["R","U","D"]
li2=["L","U","D"]
s=input()
b=True
for i in range(len(s)):
    if(i+1)%2==0:
        if s[i] not in li2:
            b=False
            break
    else:
        if s[i] not in li:
            b=False
            break
if b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();print("YNeos"[(("L" in set(s[::2]))or("R" in set(s[1::2])))::2])

Submission status: Accepted

Solution code:
S = str(input())
odd = []
even = []
A = False
B = False

for i in range(len(S)):
    if i % 2 == 0:
        odd.append(S[i])
    else:
        even.append(S[i])

for i in range(len(odd)):
    if odd[i] == 'R' or odd[i] == 'U' or odd[i] == 'D':
        A = True
    else:
        A = False
        break

for i in range(len(even)):
    if even[i] == 'L' or even[i] == 'U' or even[i] == 'D':
        B = True
    else:
        B = False
        break

if len(S) == 1:
    if A == True:
        print('Yes')
    else:
        print('No')
else:
    if A == True and B == True:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
f=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:
            f=0
    else:
        if s[i]=="L" or s[i]=="U" or s[i]=="D":
            continue
        else:
            f=0
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
 
S_contains = list(v for v in S)
 
even_list = S_contains[1::2]
odd_list = S_contains[0::2]
 
if 'R' in even_list or 'L' in odd_list:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = input()
odd_list = []
even_list = []
for i in range(len(S)-1):
    if i%2!=0:
        even_list.append(S[i])
    else:
        odd_list.append(S[i])
# print(odd_list)
# print(even_list)
if "L" in odd_list:
    print("No")
elif "R" in even_list:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
ss = raw_input()
odd = ["R", "U", "D"]
even = ["L", "U", "D"]
odds = []
evens = []

for i, s in enumerate(ss, 1):
    if i % 2 == 0:
        if s in even:
            evens.append(True)
        else:
            evens.append(False)
    else:
        if s in odd:
            odds.append(True)
        else:
            odds.append(False)
print 'Yes' if all(odds) and all(evens) else 'No'

Submission status: Accepted

Solution code:
S=input()
for n in range(len(S)):
    if n % 2 != 0:
        if S[n]=='R':
            print('No')
            exit(0)
    elif n % 2 == 0:
        if S[n] == 'L':
            print('No')
            exit(0)
print('Yes')

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()
ans = "Yes"
for i,v in enumerate(s):
    if i%2==0:
        if v=="L":
            ans = "No"
    else:
        if v=="R":
            ans = "No"
print(ans)

Submission status: Accepted

Solution code:
ws = input()
list_e=[]
list_o=[]

for n, v in enumerate(ws):
  if n % 2 == 0:
    list_e.append(v)
  else:
    list_o.append(v)

if "L" not in list_e and "R" not in list_o:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

s=input()

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

Submission status: Accepted

Solution code:
import sys

s = input()

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

Submission status: Accepted

Solution code:
import sys

s = input()

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

Submission status: Accepted

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

if a.find("L") != -1 or b.find("R") != -1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()
valid = True
for i in range(len(s)):
    if i % 2 == 1:
        if not (s[i] in ['L', 'U', 'D']):
            valid = False
            break
    else:
        if not (s[i] in ['R', 'U', 'D']):
            valid = False
            break
if valid:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a = 'Yes'

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

print(a)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
answer=1
for i in range(n):
    if i%2==0:
        if s[i]=='L':
            answer=answer*0
    else:
         if s[i]=='R':
            answer=answer*0
if answer==0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
# B - Tap Dance
S = input()
j = 1
flag = False
for i in S:
    if j % 2 != 0 :
        if(i == 'L'):
            flag = True
            break
    else:
        if(i == 'R'):
            flag = True
            break
    j= j+1

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

Submission status: Accepted

Solution code:
s = list(input())
odd_s = "".join(s[::2])
even_s = "".join(s[1::2])

odd_c = ["R","U","D"]
even_c = ["L","U","D"]

flag = True

for w in odd_s:
    if w not  in odd_c:
        flag = False
        
for w in even_s:
    if w not  in even_c:
        flag = False
        
if flag :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())

Sodd = S[::2]
Seven = S[1::2]

if "L" in Sodd:
  print("No")
elif "R" in Seven:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = list(input())

a = ['R', 'U', 'D']
b = ['L', 'U', 'D']

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

if (solve(s)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=[i for i in 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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
str_list = list(S)
odd_str = str_list[0::2]
even_str = str_list[1::2]
if ('R' in even_str):
  print('No')
elif ('L' in odd_str):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())

flag=0

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

Submission status: Accepted

Solution code:
S=input()
flg=0
for i in range(len(S)):
    if i%2==0:
        if S[i]=="L":
            flg=1
            break
    else:
        if S[i]=="R":
            flg=1
            break

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

Submission status: Accepted

Solution code:
s=input()

slist=list(s)
i=0
l=0

for sin in slist:
    if i%2==0:
        if sin=='L':
            print('No')
            l=1
            break
    else:
        if sin=='R':
            print('No')
            l=1
            break
    i+=1    

if l==0:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
S = input()
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L":
      print("No")
      sys.exit()
  else:
    if S[i] == "R":
      print("No")
      sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
s=list(input())

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

Submission status: Accepted

Solution code:
S = input()
cnt = 0
out = 0

for i in S:
  cnt += 1
  if out == 1:
    break
  if cnt % 2 == 0:
    if i == 'R':
      out = 1
  else:
    if i == 'L':
      out = 1

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

Submission status: Accepted

Solution code:
import sys
S = raw_input()
d = ["L","R","U","D"]
k = ["R","U","D"]
g = ["L","U","D"]
def r():
    print("No")
    sys.exit()
x = 1
if not (1 <= len(S) and len(S) <= 100): r()
for c in S:
    if not c in d:
        r()
    if(x % 2 == 0):
        if not c in g:
            r()
    else:
        if not c in k:
            r()
    x += 1

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
S_odd = S[::2]
S_even = S[1::2]
if S_odd.count('L') == 0 and S_even.count('R') == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
tap = input()
int_len=len(tap)
bad_count=0

for i in range(int_len):
    if (i+1)%2==1 and tap[i]=="L":
        bad_count = bad_count +1
    elif (i+1)%2==0 and tap[i]=="R":
        bad_count = bad_count +1
if bad_count==0:print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
S = input()

ki = set(S[0::2])
gu = set(S[1::2])


if 'L' in ki or 'R' in gu:
    print('No')
else:
    print('Yes')

# 1234567
# RUDLUDR

Submission status: Accepted

Solution code:
s=list(input())

ans = 0

for i,j in enumerate(s):
  if (i%2==0 and j=="L") or (i%2==1 and j=="R"):
    ans = 1

print(["Yes","No"][ans])

Submission status: Accepted

Solution code:
import sys

text = input()
for i in range(len(text)):
  if (i%2==0 and text[i]!="L") or (i%2==1 and text[i]!="R"):
    continue
  else:
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()

total = 0

for i in range(len(S)):
    if (i % 2) == 0:
        if (S[i] == 'R') or (S[i] == 'U') or (S[i] == 'D'):
            pass
        else:
            total += 1
    else:
        if (S[i] == 'L') or (S[i] == 'U') or (S[i] == 'D'):
            pass
        else:
            total += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
i = 0
for s in range(len(S)):
  t = s + 1
  if S[s] == "U" or S[s] =="D":
    i += 1
  if t%2 !=0 :
    if S[s] == "R":
      i +=1
  if t%2==0:
    if S[s] == "L":
      i += 1
if i == len(S):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
tap = input()

tap_list = list(tap)
result_list = []

for val in range(len(tap)):
	if ('R' in tap_list[val]) and (val%2 == 1) :
		result_list.insert(0,1)
	elif ('L' in tap_list[val])and (val%2 == 0) :
		result_list.insert(0,1)
	else:
		result_list.insert(0,0)

if 1 in result_list :
	print('No')	
else :
		print('Yes')

Submission status: Accepted

Solution code:
S = str(input())

odd_list = ['R', 'U', 'D']
even_list = ['L', 'U', 'D']
indic_list = []
newS = []

for j in S:
    newS.append(j)

for index, i in enumerate(newS):
    if (index+1) % 2 == 0:
        if i in even_list:
            indic_list.append(True)
        else:
            indic_list.append(False)
    else:
        if i in odd_list:
            indic_list.append(True)
        else:
            indic_list.append(False)

if all(indic_list):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())

flag = 0

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


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

Submission status: Accepted

Solution code:
step = input()
ans = 'Yes'

for i,com in enumerate(step):
  if (com == 'R' and (i+1)%2 == 0) or (com == 'L' and (i+1)%2 == 1):
    ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
S = list(input())

for i in range(len(S)):
	temp = S[i]
	if((i+1) % 2 == 0): # 偶数文字目の時
		if(temp == 'R'): # 踏みにくい文字であった場合
			print('No')
			exit(0)
	else: # 奇数文字目の時
		if(temp == 'L'): # 踏みにくい文字であった場合
			print('No')
			exit(0)
print('Yes')

Submission status: Accepted

Solution code:
S = input()
ans = "Yes"

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

Submission status: Accepted

Solution code:
w= input()
a=w[::2]
b=w[1::2]

c="L" in a
d="R" in b

if c ==True:
    print("No")
elif d == True:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
flag=True
i=1
for c in S:
#    print(f'i={i},c={c}')
    if (i%2==1 and c=='L') or (i%2==0 and c=='R'):
        flag=False
        break;
    i+=1
print('Yes' if flag else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

easy_step = True
for i in range(len(S)):
    if (i+1) % 2 == 0:
        easy_step &= S[i] in ['L', "U", "D"]
    else:
        easy_step &= S[i] in ["R", "U", "D"]
if easy_step:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()




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

Submission status: Accepted

Solution code:
import sys
import math
import numpy as np
import copy

def main():
    s = input()
    ret = True
    for i in range(len(s)):
        c = s[i]
        if i % 2 == 0 and c == 'L':
            ret = False
        if i % 2 == 1 and c == 'R':
            ret = False

    print("Yes" if ret else "No")
    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
import sys
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":
            continue
        else:
            print("No")
            sys.exit()
    else:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
            continue
        else:
            print("No")
            sys.exit()
else:
    print("Yes")

Submission status: Accepted

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

for i in range(0,len(s),2):
	if s[i] not in odd:
		print("No")
		exit()
		
for j in range(1,len(s),2):
	if s[j] not in even:
		print("No")
		exit()
		
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
ODD = ["R", "U", "D"]
EVEN = ["L", "U", "D"]
flag = False
for i in range(len(S)):
    if i%2 == 0:
        if not ( S[i] in ODD):
            flag = True
    if i%2 == 1:
        if not ( S[i] in EVEN):
            flag = True
if flag == False:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())
ODD = ["R", "U", "D"]
EVEN = ["L", "U", "D"]
flag = False
for i in range(len(S)):
    if i%2 == 0:
        if not ( S[i] in ODD):
            flag = True
            print("No")
    if i%2 == 1:
        if not ( S[i] in EVEN):
            flag = True
            print("No")
    if flag == True:
        break
if flag == False:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
for i, s in enumerate(S):
    if (i+1) % 2 == 0:
        if s == 'R':
            ans = 'No'
            break

    else:
        if s == 'L':
            ans = 'No'
            break

print(ans)

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
t = str(input())
s=0
k=0
for i in range(0,len(t),2):
  if(t[i]=='L'):
    s=1
for i in range(1,len(t),2):
  if(t[i]=='R'):
    k=1
if(s==1):
  print('No')
elif(k==1):
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
l=list(input())
ans="Yes"
for i in range(len(l)):
    if(i%2==0):
        if(l[i]=="L"):
            ans="No"
    else:
        if(l[i]=="R"):
            ans="No"
print(ans)

Submission status: Accepted

Solution code:
#141b
S = str(input()) #S は長さ 1 以上 100 以下の文字列

#S が以下の 2 条件を満たすとき、またその時に限り、Sを「踏みやすい」文字列といいます。
#    奇数文字目がすべて R, U, D のいずれか。
#    偶数文字目がすべて L, U, D のいずれか。
#Sが「踏みやすい」文字列なら Yes を、そうでなければ No を出力してください。

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

Submission status: Accepted

Solution code:
s = input()

if all(c in 'RUD' for c in s[::2]) and all(c in 'LUD' for c in s[1::2]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
inputs = input().rstrip()
lst = list(inputs)
flg = True

for i in range(len(lst)):
    if ((i+1) % 2) == 1:
        if (lst[i] == "L"):
            flg = False
            break
    else:
        if (lst[i] == "R"):
            flg = False
            break

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

Submission status: Accepted

Solution code:
S=list(input())
n=len(S)

for i in range(n) :
	if i%2==0 and S[i]=='L' :
		print('No')
		break
	elif i%2==1 and S[i]=='R' :
		print('No')
		break
	elif i==n-1 :
		print('Yes')

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
#coding:utf-8

if __name__ == "__main__":
    #conf_step_odd = ["R", "U", "D"]
    #conf_step_even = ["L", "U", "D"]

    S = input()
    steps_odd = S[0::2]
    steps_even = S[1::2]

    for stp in steps_odd:
        if stp == "L":
            print("No")
            exit()
    for stp in steps_even:
        if stp == "R":
            print("No")
            exit()

    print("Yes")

Submission status: Accepted

Solution code:
S = input()
o = set(S[::2])
e = set(S[1::2])
so = {'D', 'U', 'R'}
se = {'D', 'U', 'L'}
if o.issubset(so) and e.issubset(se):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
c = 0
for i in range(0,len(s)):
    if s[i] == 'U' or s[i] == 'D':
        continue
    elif s[i] == 'L':
        if i%2 == 1:
            continue
        else:
            c = 1
    else:
        if i%2 == 0:
            continue
        else:
            c = 1
if c == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

def tapDance(s_string):

    for i, word in enumerate(s_string):
        if (i + 1) % 2 == 0 and word == "R":
            return "No"
        elif (i + 1) % 2 == 1 and word == "L":
            return "No"

    return "Yes"

print(tapDance(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
pri = S[::2]
dec = S[1::2]
flag = True

if 'R' in dec:
  flag = False
if flag:
  if 'L' in pri:
    flag = False
print('Yes' if flag else 'No')

Submission status: Accepted

Solution code:
S=input()
T=(",").join(S)
U=T.split(",")

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
flag = True
for i in range(len(S)):
  if i%2 != 0 and S[i] == 'R' or i%2 == 0 and S[i] == 'L':
    flag = False

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

Submission status: Accepted

Solution code:
import re
s = input()
odd = s[::2]
eve = s[1::2]
odd_re = re.compile(r"^[RUD]*$")
eve_re = re.compile(r"^[LUD]*$")
if odd_re.findall(odd) != [] and eve_re.findall(eve) != []:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 'Yes'
S = input()
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = 'Yes'

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = 10**10

S = input()
N = len(S)
s1 = [S[i] for i in range(0, N, 2)]
s2 = [S[i] for i in range(1, N, 2)]
if 'L' in s1 or 'R' in s2:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
 
t = input()
 
t1 = t[0::2]
t2 = t[1::2]
if "L" in t1:
  print("No")
else:
  if "R" in t2:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input().rstrip()
s_len = len(s)
flag = 0
for i in range(s_len):
  if i%2==0:
    if s[i]=="L":
      flag = -1
  else:
    if s[i]=="R":
      flag = -1
if flag == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = list(input())
odd = ['R','U','D']
even  = ['L','U','D']
for i in range(len(S)):
    if i % 2 == 0 : #奇数
        if S[i] not in odd :
            print("No")
            exit()
    else:
        if S[i] not in even:
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)

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

    else:
        if S[i] == "R":
            flag = True
            break

if flag:
    print("No")

else:
    print("Yes")

Submission status: Accepted

Solution code:
odds = ["R", "U", "D"]
evens = ["L", "U", "D"]

s = input()
is_passed = True

for index, c in enumerate(s):
    if index % 2 == 0:
        if not c in odds:
            is_passed = False
    else:
        if not c in evens:
            is_passed = False

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

Submission status: Accepted

Solution code:
S=list(input())
S_odd=S[0::2]
S_even=S[1::2]

flag=True
for s_odd in S_odd:
    if not s_odd in ['R','U','D']:
        flag=False
        break
for s_even in S_even:
    if not s_even in ['L','U','D']:
        flag=False
        break
if flag==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
t = True
for i in range(n):
    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')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def solve(string):
    s = string
    return "No" if "L" in s[::2] or "R" in s[1::2] else "Yes"


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s_list = [s for s in input()]

s_odd = s_list[0::2]
s_even = s_list[1::2]


if 'L' in s_odd or 'R' in s_even:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = input()
TAP = 'x'

TAP += S

for i in range(1,len(S)+1):
  if i % 2 == 1:
    if TAP[i] != 'R' and TAP[i] != 'U' and TAP[i] != 'D':
      print('No')
      sys.exit()
  else:
    if TAP[i] != 'L' and TAP[i] != 'U' and TAP[i] != 'D':
      print('No')
      sys.exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()
L = len(S)
ans = 0
for i in range(L):
  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')

Submission status: Accepted

Solution code:
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":
            continue
        else:
            print("No")
            exit()
    else:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
            continue
        else:
            print("No")
            exit()

print("Yes")