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: Runtime Error

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################

def solve():
    s = insr()
    q = "Yes"
    for i in range(len(s)):
        if (i % 2 == 0 and a[i] == "L") or (i % 2 != 0 and a[i] == "R"):
            q = "No"
    print(q)
    
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1],1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)

def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))

def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
    
main()

Submission status: Runtime Error

Solution code:
s=input()
if set(s[::2])=={'R','U','D'} or set(s[1::2])=={'L','U','D'}:
    print('Yes')
else:print('No'

Submission status: Runtime Error

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

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

print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()

odd=[(c in "RED")for i,

if:
Yes
else:
No

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
O = ['R','U','D']
E = ['L','U','D']
ng = False
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] not in O:
      ng = True
      break
  else:
    if S[i] not in E:
      ng = True
      break
print('No') if ng print('Yes')

Submission status: Runtime Error

Solution code:
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
s=i()
for i in range(math.ceil(s/2)):
  if not s[i]=="R" or s[i]=="U" or s[i]=="D":
    print("No")
    sys.exit()
for j in range(s//2):
  if not s[i]=="L" or s[i]=="U" or s[i]=="D":
    print("No")
print('Yes')

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range (len(S)):
  if S[2i-2] == 'R' or S[2i-1]  == 'L':
    print('No')
  	quit()
print('Yes')

Submission status: Runtime Error

Solution code:
import sys
S = list(input())
S.insert(0,"X")

for i in range(1,len(S)-1,2):
  if S[i] == "L":
    print("No")
    sys.exit()
for j in range(2,len(S)-1,2):
  if S[i] == "R":
    print("No")
    sys.exit()
print"Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = list(input())
a = True

for i in range(les(s)):
    if i%2==0 and s[i]=="L":
        a = False
    elif i%2 ==1 and s[i]=="R":
        a = False
if a:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()
a = True

for i in range(les(s)):
    if i%2==0 and s[i]=="L":
        a = False
    elif i%2 ==1 and s[i]=="R":
        a = False
if a:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def f(s):
	p = True
	for u in s:
		if u not in ('RUD' if p else 'LUD'): return False
		p ^= True 
	returnTrue
print 'Yes' if f(raw_input()) else 'No'

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
"""
abc141-b
"""

S = input()

ans="Yes"

for i in range(int(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: Runtime Error

Solution code:
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]!='R'or):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=input()
T=S[::2]
U=S[1::2]
if (T.count("L")=0) and (U.count("R")=0):
      print("Yes")
else:
   print("No")

Submission status: Runtime Error

Solution code:
S=input()
T=S[0::2]
U=S[1::2]
if T.count("L")=0 and U.count("R")=0:
         print("Yes")
         else:
         print("No")

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
k=['R','U','D']
g=['L','U','D']
for i in 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')

Submission status: Runtime Error

Solution code:
s = int(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")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
not

Submission status: Runtime Error

Solution code:
S=input()
for i in range(0,(len(S)),2):
    if S[i]=='R' or S[i]=='U' or S[i]=='D':
        for j in range (1,(len(S)),2):
            if S[j]=='L' or S[j]=='U' or S[j]=='D':
                mark=True
            else:
                mark=False
                break
    else:
        mark=False
        break
print('Yes' if mark==True else 'No')

Submission status: Runtime Error

Solution code:
import sys
S = input()
L = len(S)
i = 0
while i < L:
  if L[i] not in ['R','U','D']:
    print('No')
    sys.exit(0)
  i+=2
i = 1
while i < L:
  if L[i] not in ['L','U','D']:
    print('No')
    sys.exit(0)
  i += 2
print('Yes')

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

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

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
        new =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
        new2 = True if s[i] in k else False
    else:
        new1 =True if s[i] in g else False
       
if new2 == True and new1 == True:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new2 = True if s[i] in k else False
    else:
        new1 =True if s[i] in g else False
       
if new2 == True and new1 == True:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new2 =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new2 == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
k = ['R','U','D']
g = ['L','U','D']

for i in range(n):
    if i % 2 ==0:
       new =[s[i] in k]
    else:
        new1 =[s[i] in g]
       
if new == [True] and new1 == [True]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import sys
import collections
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N,K,Q=nm()
Al=[0]*N
for i in range(Q):
    Al[i]=ni()



for i in range(N):
    #print(Al.count(i+1))
    print('No' if (K-Q+Al.count(i+1)<1) else 'Yes')

Submission status: Runtime Error

Solution code:
S = input()

N=len(S)
flag=1

for i in range(N//2):
  if S[i*2]=='L':
    flag=0
  if S[i*2+1]=='R':
    flag=0

if S[(i+1)*2]=='L':
  flag=0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(int(n/2)+1):
    if S[2*i] != "R" and S[2*i] != "U" and S[2*i] != "D":
        print("No")
        exit()
for i in range(int(n/2)):
    if S[2*i + 1] != "L" and S[2*i + 1] != "U" and S[2*i + 1] != "D":
        print("No")
        exit()
print("Yes")

Submission status: Runtime Error

Solution code:
s = list(input())

for i in range(len(s), 2):
    if s[i] == 'L':
        print('No')
        break

for j in range(1,len(s), 2):
    if s[j] == 'R':
        print('No')
        break

print('Yes')

Submission status: Runtime Error

Solution code:
s = list(input())

for i in range(len(s), 2):
    if s[i] == 'L':
        print('No')
        break

for j in range(1,len(s), 2):
    if s[j] == 'R':
        print('No')
        break

else:print('Yes')

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(:len(S):2):
  if S[i] == 'R':
    print('No')
    exit()
for j in range(1:len(S):2):
  if S[j] == 'L':
    print('NO')
    exit()
print('Yes')

Submission status: Runtime Error

Solution code:
s=input()
even = ["L","U","D"]
odd = ["R", "U", "D"]
f = false
for i in range(len(s)):
  if i%2:
    if s[i] not in even:
      f = True
  else:
    if s[i] not in odd:
      f = True
if f:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
import sys
S=input()
if len(S)>1:
    for i in range(n//2):
        s=S[2*i]
        if s=="L":
            print("No")
            sys.exit()
        s=S[2*i+1]
        if s=="R":
            print("No")
            sys.exit()
if len(S)%2==1:
    s=S[-1]
    if s=="L":
        print("No")
        sys.exit()
print("Yes")

Submission status: Runtime Error

Solution code:
import sys
S=input()
if len(S)>1:
    for i in range(n//2):
        s=S[2*i]
        if s=="L":
            print("No")
            sys.exit()
        s=S[2*i+1]
        if s=="R":
            print("No")
            sys.exit()
if n%2==1:
    s=S[-1]
    if s=="L":
        print("No")
        sys.exit()
print("Yes")

Submission status: Runtime Error

Solution code:
import sys
S=input()
if n>1:
    for i in range(n//2):
        s=S[2*i]
        if s=="L":
            print("No")
            sys.exit()
        s=S[2*i+1]
        if s=="R":
            print("No")
            sys.exit()
if n%2==1:
    s=S[-1]
    if s=="L":
        print("No")
        sys.exit()
print("Yes")

Submission status: Runtime Error

Solution code:
import sys
S=input()
for i in range(n//2):
    s=S[2*i]
    if s=="L":
        print("No")
        sys.exit()
    s=S[2*i+1]
    if s=="R":
        print("No")
        sys.exit()
if n%2==1:
    s=S[-1]
    if s=="L":
        print("No")
        sys.exit()
print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#奇数文字目がすべて R, U, D のいずれか。
#偶数文字目がすべて L, U, D のいずれか。

#文字列の入力
S = input()
S_list = []
S_list = list(S)
counter = 0

for i in range(len(S_list)):
  #奇数
  if(i%2 == 0):
    if((S_list[i] == "R")or(S_list[i] == "U")or(S_list[i] == "D")):
      counter = counter + 1
  else:
    if((S_list[i] == "L")or(S_list[i] == "U")or(S_list[i] == "D")):
      counter = counter + 1
      
if(counter = len(S_list)):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
function Main(input) {
  const step = input.trim().split('');
  const even = ['L', 'U', 'D'];
  const odd = ['R', 'U', 'D'];
  var easy = true;

  for (var i in step) {
    var cnt = i + 1
    if (cnt % 2 == 0) {
      if ( even.indexOf(step[i]) !== -1 ) easy = false;
    } else {
      if ( odd.indexOf(step[i]) !== -1 ) easy = false;
    }
  }

  console.log(easy ? 'Yes':'No')
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
RDULULDURURLRDULRLR

Submission status: Runtime Error

Solution code:
elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Runtime Error

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a = "S":
        print("No")
        flag = "unko"
    else:
        pass

elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Runtime Error

Solution code:
 import re

 s = input()
 p = re.compile(r'^([^L][^R])*[^L]?$')
 if p.match(s):

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

Submission status: Runtime Error

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""

for i in range(len(odd)):
  check = 0
  if odd[i] == "L" or "U" or "D":
    check += 1
  
if check == len(odd):
  x1 = "Y"
  
for i in range(len(even)):
  check2 = 0
  if even[i] == "R" or "U" or "D":
    check2 += 1
 
if check2 == len(even):
  x2 = "Y"
  
  
if x1 and x2 == "Y":
  xx = "Yes"
  
  
print(xx)

Submission status: Runtime Error

Solution code:
Tap = input()
len_Tap = len(Tap)
count = 0

for i in range(len_Tap):
    if (i+1) % 2 == 1:
        if Tap[i] == 'R' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1
    
    else:
        if Tap[i] == 'L' or Tap[i] == 'U' or Tap[i] == 'D':
            count += 1

if count == len_Tap:
    print(Yes)

else:
    print(No)

Submission status: Runtime Error

Solution code:
ugrd={'L'}
grd={'R'}
s=string(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  elif i==len(s)-1:
    print('Yes')

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	ans = True:
	for i,s in enumerate(S):
		if (i % 2 == 1 and s=='R') or (i % 2 == 0 and s=='L'):
			ans=False
	if(ans):
		print('Yes')
	else:
		print('No')

main()

Submission status: Runtime Error

Solution code:
package main

import(
  "fmt"
  "strings"
)

func main() {
  var s string
  fmt.Scan(&s)
  
  ans := "Yes"
  for i, char := range strings.Split(s, "") {
    i++
    if (i % 2 == 0 && char == "R") || (i % 2 != 0 && char == "L") {
      ans = "No"
      break
    }
  }
  fmt.Println(ans)
}

Submission status: Runtime Error

Solution code:
import numpy as np

s = input()
int a = 0

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

Submission status: Runtime Error

Solution code:
N = input()

M = int(len(N))//2
flag = True

for i in range(M+1):
  if N[i*2] == "R":
    flag = False
  elif N[i*2+1] == "L":
    flag = False
if flag == True:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = str(input())

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

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

Submission status: Runtime Error

Solution code:
S = list(input())

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

if num != 0:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())

if S[0] == "L" and S[2] == "L":
    print("No")
elif S[1] == "R" and S[3] == "R":
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for i in range(0, n, 2):
  if s[i] == 'L':
    f = False

Submission status: Runtime Error

Solution code:
import sys
import math
s=list(map(str,input()))
for i in range(math.ceil(len(s)/2)):
    if s[2*i]!='L' and s[2*i]!='U' and s[2*i]!='D':
        print('No')
        sys.exit()
for j in range(len(s)//2):
    if [2*i+1]!='R' and s[2*i+1]!='U' and s[2*i+1]!='D':
        print('No')
        sys.exit()
print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
ans = 'Yes'
for i in range((len(S) + 1) // 2):
  if S[2*i] == 'L' or S[2*i + 1] == 'R':
    ans = 'No'
    break

print(ans)

Submission status: Runtime Error

Solution code:
s=str(input())

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

Submission status: Runtime Error

Solution code:
s=str(input())

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

Submission status: Runtime Error

Solution code:
s=str(input())

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

Submission status: Runtime Error

Solution code:
s = list(input())
odd = []
even = []
for i in range(len(s)):
  if i % 2 == 0:
    odd.aapend(s[i])
  else:
    even.append(s[i])
o = 0
e = 0
if "L" in odd:
  o = -1
if "R" in even:
  e = -1
if o * e == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S = list(input())
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ka += 1
print(rtu)

Submission status: Runtime Error

Solution code:
ULURU

Submission status: Runtime Error

Solution code:
S = list(map(str, input()))
count1 = 0
count2 = 1
while count2 < len(S):        
    if S[count2] == 'R':
        print('No')
        break
    else:
        count2 += 2
while count1+1 <= len(S):
    if S[count1] == 'L':
        print('No')
        break
    else: count +=2

else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = input()

oddStep = ['R','U','D']
evenStep = ['L','U','D']
CNST_NO = 'No'
CNST_YES = 'Yes'
good_step = CNST_NO

for i, c in s:
  if i % 2 == 0:
    if c in oddStep:
		good_step = CNST_YES
  else:
    if c in evenStep:
		good_step = CNST_YES
  if good_step==CNST_YES:
    break
print( good_step )

Submission status: Runtime Error

Solution code:
S=input()
K=[]
G[]
for i in range(0,len(S),2):
  K.append(S[i])
  try:
    G.append(S[i+1])
  except:
    pass
if ('L' in K) or ('R' in G):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in s:
  if i == 'U' or i == 'D':
    continue
  else:
    if i%2 == 0:
      if i != 'L':
        print("No")
        exit()
    else:
      if i != 'R':
        print("No")
        exit()
print("Yes")

Submission status: Runtime Error

Solution code:
s = list(input())
n = len(s)
#print(n)
k,g=[],[]
for i in range(n):
    if i%2==0:
        k.append(s[i])
    else:
        g.append(s[i])
#print(k)
#print(g)
for j in k:
    if j == 'L':
        print('No')
        break

else:
    for l in g:
        if l == 'R':
            print('No')
            break
    else:
        print('Yes')
        break

Submission status: Runtime Error

Solution code:
s = list(input())

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

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
S = input()
is_easy = False
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == "R":
      print("No")
      is_easy = True
      break
  else:
   	if S[i] == "L":
      print("No")
      is_easy = True
      break
      
if not is_diff:
  print("Yes")