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()
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] != "R" and s[i] != "U" and s[i] != "D":
            print("No")
            break
    else:
        if s[i] != "L" and s[i] != "U" and s[i] != "D":
            print("No")
            break
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
moves = input()

easy = True
for i in range(len(moves)):
  if i % 2 == 0 and not moves[i] in "RUD":
    easy = False
    break
  if i % 2 == 1 and not moves[i] in "LUD":
    easy = False
    break

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ans = True
S = input()
i = 0
while i < len(S):
  if S[i] == "L":
    ans = False
  i += 2
j = 1
while j < len(S):
  if S[j] == "R":
    ans = False
  j += 2
if ans:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
string = input()
odd = 'RUD'
even = 'LUD'
ans = "Yes"
for i in range(len(string)):
    if (i % 2 != 0 and string[i] not in even) or (i % 2 == 0 and string[i] not in odd):
        ans = "No"
        break
print (ans)

Submission status: Accepted

Solution code:
char_list = input()
odd = char_list[0::2]
even = char_list[1::2]
odd_easy = ['R','U','D']
even_easy = ['L','U','D']
odd_result = []
even_result = []
true_false = []

for char in odd:
 if char in odd_easy:
  odd_result.append('True')
 else:
  odd_result.append('False')

for char in even:
 if char in even_easy:
  even_result.append('True')
 else:
  even_result.append('False')

true_false = odd_result + even_result

if 'False' in true_false:
 print('No')
else:
 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()
ans = "Yes"
for i in range(len(s)):
    if (i+ 1)% 2:
       if s[i] == "L":
           ans = "No"
    else:
        if s[i] == "R":
            ans = "No"
print(ans)

Submission status: Accepted

Solution code:
s = list(input())

f = False

for i in range(len(s)):
    if i%2==0:
        if s[i]!='R' and s[i]!='U' and s[i]!='D':
            f = True
    else:
        if s[i]!='L' and s[i]!='U' and s[i]!='D':
            f = True
if f:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
Str = input()
num = 0
for i in range(len(Str)):
    char = Str[i]
    if (i + 1) % 2 == 0 and i != 0:
        if char != "L" and char != "U" and char != "D":
            num = 1
    else:
        if char != "R" and char != "U" and char != "D":
            num = 1
if num == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=list(input())
l=len(S)
e=0
ki=["R","U","D"]
gu=["L","U","D"]
tmp=l//2
if l%2 ==0:
	for i in range(tmp):
		char1=S[2*i]
		char2=S[2*i+1]
		if char1 not in ki:
			e=1
		if char2 not in gu:
			e=1


else:
	charL=S[l-1]
	if charL not in ki:
		e=1	

	else:
		for i in range(tmp): 
			char1=S[2*i]
			char2=S[2*i+1]
			if char1 not in ki:
				e=1
			if char2 not in gu:
				e=1

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

Submission status: Accepted

Solution code:
dance = input()
i=1
flag=0
for char in dance:
  if i%2==1:
    if not char in ['R','U','D']:
      flag=1
      break
  else:
    if not char in ['L','U','D']:
      flag=1
      break   
  i += 1
if flag == 1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
N = 0
for i in range(l):
    if(i % 2 == 0):
        if S[i] != "R" and S[i] != "U" and S[i] != "D":
            N = 1
    else:
        if S[i] != "L" and S[i] != "U" and S[i] != "D":
            N = 1

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

Submission status: Accepted

Solution code:
step = input()

ng = ["L", "R"]

for i in range(0, len(step)):
  if step[i] == ng[i%2]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

if all(map(lambda _s: _s in "RUD", s[0::2])) and all(map(lambda _s: _s in "LUD", s[1::2])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()

i=1
ans="Yes"
for _s in s:
    if (i%2==0 and _s == "R") or (i%2==1 and _s == "L"):
        ans="No"
        break
    i+=1
print(ans)

Submission status: Accepted

Solution code:
S=str(input())
r='Yes'
for i,x in enumerate(S):
    if i%2==0 and x=='L':
        r='No'
        break
    if i%2==1 and x=='R':
        r='No'
        break
print(r)

Submission status: Accepted

Solution code:
s = input()

good = True
for i, c in enumerate(s):
    if (i+1)&1 == 0 and c == 'R':
        good = False
        break
    if (i+1)&1 == 1 and c == 'L':
        good = False
        break

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

Submission status: Accepted

Solution code:
step = input()
ok = True
for i, tap in enumerate(step):
    if i % 2 == 1 and tap in ['R'] :
        ok = False
    elif i % 2 == 0 and tap in ['L']:
        ok = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
i = 1
ans = 'Yes'
l1 = ('R', 'U', 'D')
l2 = ('L', 'U', 'D')
for c in s:
    if i % 2 == 1:
        if c not in l1:
            ans = 'No'
            break
    else:
        if c not in l2:
            ans = 'No'
            break
    i += 1
print(ans)

Submission status: Accepted

Solution code:
# 奇数文字目→R U D　偶数文字目→L U D
S = ' ' + input()  
flag = True 

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

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

Submission status: Accepted

Solution code:
# 入力の取得
s = input()

even = ""
odd  = ""

#1文字ずつループ
for idx,s in enumerate(s):
    if idx == 0 or idx % 2 == 0:
        even += s
    else:
        odd += s

#判定
even = even.replace('R', '').replace('U', '').replace('D', '')
odd  = odd.replace('L', '').replace('U', '').replace('D', '')


if even == "" and odd == "":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
a=0


for x in range(len(s)):
    if x%2 == 0:
        if s[x]=="R" or s[x]== "U" or s[x]== "D":
            a=a
        else:

            a=a+1
    else:
        if s[x] == "L" or s[x]== "U" or s[x]== "D":
            a=a
        else:
            a=a+1

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

else:
    print("No")

Submission status: Accepted

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

for i, s in enumerate(S):
    if i % 2: # odd
        if s == "R":
            o = "No"
            break
        
    else:
        if s == "L":
            o = "No"
            break

print(o)

Submission status: Accepted

Solution code:
s = str(input())
Odd = s[::2]
Even = s[1::2]
Ocount =0
Ecount =0
for i in range(len(Odd)):
  if Odd[i] == "R" or Odd[i] == "U" or Odd[i] == "D":
     Ocount +=1
     if len(Even)==0:
        print("Yes")
        quit()      
for i in range(len(Even)):
  if Even[i] == "L" or Even[i] == "U" or Even[i] == "D":
    Ecount +=1
  if Ecount == len(Even) and Ocount == len(Odd):
    print("Yes")
    quit()
print("No")

Submission status: Accepted

Solution code:
S = input()

for i,j in enumerate(list(S)):
    #奇数
    if (i % 2 != 0 and j == 'R') or (i % 2 == 0 and j == 'L'):
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
S = list(input())
odd = ['R','U','D']
even = ['L','U','D']
boolean = []
for i in range(0,len(S)):
    if (i+1) % 2 == 1:
        boolean.append(S[i] in odd)
    else:
        boolean.append(S[i] in even)
if all(boolean):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,collections,itertools,re,math,fractions,decimal,random,array,bisect,heapq

# decimal.getcontext().prec = 50
# sys.setrecursionlimit(10000)
# MOD = 10**9 + 7

def solve(f):
    s = f.read_str()
    if 'L' in s[::2]:
        return "No"
    if 'R' in s[1::2]:
        return "No"
    return "Yes"


class Reader(object):
    def __init__(self, filename=None):
        self.file = open(filename) if filename is not None else None
        self.case = 1

    def __readline(self):
        return self.file.next().strip() if self.file else raw_input()

    def next_case(self):
        self.file.next()
        self.case += 1

    def read_int(self): return int(self.__readline())
    def read_float(self): return float(self.__readline())
    def read_long(self): return long(self.__readline())
    def read_decimal(self): return decimal.Decimal(self.__readline())
    def read_str(self): return self.__readline()

    def read_int_list(self): return map(int, self.__readline().split())
    def read_float_list(self): return map(float, self.__readline().split())
    def read_long_list(self): return map(long, self.__readline().split())
    def read_decimal_list(self): return map(decimal.Decimal, self.__readline().split())
    def read_str_list(self): return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv) > 1 else None
    f = Reader(filename)
    if f.file:
        while True:
            print "Case #%d\n"%f.case, solve(f)
            try:
                f.next_case()
            except StopIteration:
                break
    else:
        print solve(f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
index =-1
Odd =[]
Even =[]
for i in S:
	index +=1
	if index % 2 == 0 :
		Odd.append(i)
	else:
		Even.append(i)
print("No" if 'L' in Odd or "R" in Even else 'Yes' )

Submission status: Accepted

Solution code:
S = input()

for i in range(len(S)):
  if i % 2 == 0:
    if S[i] in {'R','U','D'}:
      continue
    else:
      print('No')
      exit()
  else:
    if S[i] in {'L','U','D'}:
      continue
    else:
      print('No')
      exit()

print('Yes')

Submission status: Accepted

Solution code:
s = input()

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

odd_list = list(odd)
even_list = list(even)

for c in odd_list:
  if c == 'L':
    print('No')
    exit()

for c in even_list:
  if c == 'R':
    print('No')
    exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()
print(
    "Yes" if sum(
        [1 if i % 2 == 0 and S[i] in "RUD" else
         1 if i % 2 != 0 and S[i] in "LUD" else 0
         for i in range(len(S))]) == len(S)
    else "No")

Submission status: Accepted

Solution code:
input = input()

flag = 0
kisu = 1

for i in input:
	if kisu == 1:
		if i == "L":
			flag = 1
		kisu = 0
	else:
		if i == "R":
			flag = 1
		kisu = 1
	

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = list(input())

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

isEasy = True
for i in range(len(s)):
    if i%2 == 1:
        if s[i] in even:
            continue
        else:
            isEasy = False
    else:
        if s[i] in odd:
            continue
        else:
            isEasy = False

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 天気の入力
s = (input())
# 出力
odds = s[::2] # 奇数
evens = s[1::2] # 偶数
if 'L' in odds:
    print('No')
elif 'R' in evens:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
length  = len(S)

for i in range(0,length):
  #print(S[i])

  if (i%2==0 and S[i]=='L'):
    ans ='No'
    
  if (i%2==1 and S[i]=='R'):
    ans='No'
    
print(ans)

Submission status: Accepted

Solution code:
flags = ['Yes', 'No']

input_s = input()

odd_s = input_s[0::2]
even_s = input_s[1::2]

no_flag = ('L' in odd_s) | ('R' in even_s)

print(flags[no_flag])

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
if 'L' in S[::2]:ans = 'No'
elif 'R' in S[1::2]: ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
f = True
for index, i in enumerate(s):
    if(index % 2 == 0):
        if(i == 'L'):
            f = False
            break
    if(index % 2 == 1):
        if(i == 'R'):
            f = False
            break
if(f):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    d = {"Sunny":1 , "Cloudy":2, "Rainy":0}
    a = ["Sunny", "Cloudy", "Rainy"]
    print(a[d[input()]])
    return

#B
def B():
    s = S()
    for i, si in enumerate(s):
        if i % 2:
            if si == "R":
                print("No")
                return
        else:
            if si == "L":
                print("No")
                return
    print("Yes")
    return

#C
def C():
    n, k, q = LI()
    d = [0] * n
    for _ in range(q):
        a = II() - 1
        d[a] += 1
    for a in d:
        if k - (q - a) > 0:
            print("Yes")
        else:
            print("No")
    return

#D
def D():
    n, = LI()
    a = LI()
    q = []
    for ai in a:
        heappush(q, ai)
    for _ in range(m):
        heappush(q, heappop(q) / 2)
    ans = 0
    while q:
        ans += int(heappop(q))
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random


def main():
    s = input()
    f_flag=0
    
    for i in range(len(s)):
        if i%2 == 0:
            if s[i] == "L":
                f_flag=1
        else:
            if s[i] == "R":
                f_flag=1

    if f_flag==0:
        print("Yes")
    else :
        print("No")
        
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
dance = input()
even = "R"
odd = "L"

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

Submission status: Accepted

Solution code:
#n,m=map(int,input().split())
#p_3,p_4=map(int,input().split())
#n=int(input())
#a=int(input())
#b=int(input())
s=list(input())
#T=input()
#recipe=[list(input().split())for _ in range(n)]
#m=int(input())
#have=[list(input().split())for _ in range(m)]
#s=[list(input())for _ in range(n)]
#b=list(map(int,input().split()))
#b=list(map(int,input().split()))
#c=list(map(int,input().split()))
#c=list(map(float,input().split()))
#n=int(input())
#s=[list(map(int,input().split()))for _ in range(n)]
#s=[list(input().split())for _ in range(n)]
#s=[input()for _ in range(n)]
judge=True
for i in range(len(s)):
    if i%2==0:
        if s[i]=="L":
            judge=False
    else:
        if s[i]=="R":
            judge=False
print("Yes") if judge else print("No")

Submission status: Accepted

Solution code:
S = list(input())

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

print('Yes')

Submission status: Accepted

Solution code:
import re
 
s = input()
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(s):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
a=input()

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

print("Yes")

Submission status: Accepted

Solution code:
s=input()

i=0
flug=0
for x in range(1,len(s)+1):
    if(x%2==1):
        if(s[x-1] =='L'):
            flug=1
            break
    else:
        if(s[x-1] =='R'):
            flug=1
            break

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

Submission status: Accepted

Solution code:
a = input()

b =  ['R','U','D']
c =  ['L','U','D']
f= 0
for n,x in enumerate(a):
    if n%2==0 and x not in b : f = 1
    elif n%2==1 and x not in c : f = 1
def Y(a,t = 0):
    if a==t : print('YES')
    else : print('NO')
def y(a, t =0):
    if a==t : print('Yes')
    else : print('No')
y(f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = ' ' + input()
even_pat = ['R','U','D']
odd_pat = ['L','U','D']

flag = True

for i in range(1,len(S)):
    if i % 2 == 1:
        if not(S[i] in even_pat):
            flag = False
            break
    
    else:
        if not(S[i] in odd_pat):
            flag = False
            break

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

Submission status: Accepted

Solution code:
#atcoder beginner contest 141

#atcoder beginner contest 141
tap = input("")
tap_num = 0
success = 0

for char in tap:
    if tap_num % 2 == 0:
        if char =="R" or char == "U" or char == "D":
            success += 1
            
    else:
        if char =="L" or char == "U" or char == "D":
            success += 1

    tap_num += 1

if success == tap_num:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from re import match

S = input()

oddStep = r"R|U|D"
evenStep = r"L|U|D"

for st in S[0::2]:
	if not match(oddStep, st):
		print('No')
		exit()
for st in S[1::2]:
	if not match(evenStep, st):
		print('No')
		exit()
print('Yes')

Submission status: Accepted

Solution code:
lis = list(str(input()))
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
step_count = 0
ans='Yes'
for step in S:
    step_count += 1
    if step_count%2:
        if step == 'L':
            ans='No'
            break
            
    else:
        if step == 'R':
            ans='No'
            break
print(ans)

Submission status: Accepted

Solution code:
S = input()

S_even = S[0::2]
S_odd  = S[1::2]

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

Submission status: Accepted

Solution code:
str = list(input())

ok = True
for i in range(len(str)):
    if i % 2 == 0:
        if str[i] in ["R", "U", "D"]:
            pass
        else:
            ok = False

            
    else:
        if str[i] in ["L", "U", "D"]:
            pass
        else:
            ok = False


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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()

for i in range(0,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:
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
  elif i==len(s)-1:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

count = 0
for i in S:
    if count % 2 == 0:
        if i =='L':
            print('No')
            break
        else:
            count += 1
            continue
    else:
        if i == 'R':
            print('No')
            break
        else:
            count += 1
            continue

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

Submission status: Accepted

Solution code:
s = input()

even = []
odd = []
for i, j in enumerate(s):
    if i % 2 == 0:
        odd.append(j)
    else:
        even.append(j)

ans = 'No'
count = 0
for i in odd:
    if i == 'R' or i == 'U' or i == 'D':
        count+=1


count2 = 0
for i in even:
    if i == 'L' or i == 'U' or i == 'D':
        count2 +=1


if count == len(odd) and count2 == len(even):
    ans = 'Yes'


print(ans)

Submission status: Accepted

Solution code:
s = input()

ans = True
odd = True
for c in s:
    if odd:
        if c == 'L':
            ans = False
    else:
        if c == 'R':
            ans = False
    odd = not odd
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
y=x[0::2]
z=x[1::2]
y=y.replace("U","")
y=y.replace("D","")
y=y.replace("R","")
z=z.replace("U","")
z=z.replace("D","")
z=z.replace("L","")
if y=="" and z=="":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#coding:utf-8

S = input()

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    l = len(S)
    ans = "Yes"
    for i in range(l):
        if (i % 2 == 0 and S[i] == "L") or (i % 2 != 0 and S[i] == "R"):
            ans = "No"
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = list(str(input()))
S.insert(0, "L")

c = 0
for s in S:
    if c%2 == 0:
        if not((s=='L') or (s=='U') or (s=='D')):
            print('No')
            exit()
    else:
        if not((s=='R') or (s=='U') or (s=='D')):
            print('No')
            exit()
    c += 1
print('Yes')

Submission status: Accepted

Solution code:
S=list(input())
A=S[::2]
B=S[1::2]
if 'L' in A:
  print('No')
elif 'R' in B:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
S = input()

answer = 'Yes'

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

print(answer)

Submission status: Accepted

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

print(f)

Submission status: Accepted

Solution code:
S = input()
count = 0
flag = 0
for s in S:
    count += 1
    if count % 2 == 1:
        if s != "R" and s != "U" and  s != "D":
            flag = 1
    if count % 2 == 0:
        if s != "L" and s != "U" and s != "D":
            flag = 1
if flag == 0:
    print("Yes")
elif flag == 1:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
def is_easy(steps):
    for i, step in enumerate(steps):
        if i % 2 == 0 and step == 'L':
            return 'No'
        elif i % 2 == 1 and step == 'R':
            return 'No'
    return 'Yes'
  
steps = input()
print(is_easy(steps))

Submission status: Accepted

Solution code:
s=input()
i,b=0,0
while i<len(s):
	if (((s[i]=='R') & (i%2==1))|((s[i]=='L') & (i%2==0))):
		b=1
		break
	i+=1
if(b):
	print('No')
else:
	print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
A=S[::2]
B=S[1::2]
if 'L' in A:
  print('No')
elif 'R' in B:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-

MOD = 10 ** 9 + 7

S = input()

ans = 0
for i in range(len(S)):
    if i % 2 == 0 and S[i] in 'RUD':
        continue
    elif i % 2 == 1 and S[i] in 'LUD':
        continue
    else:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
dance = input()
judge = True

for i in range(len(dance)):
    if i % 2 == 1 and dance[i] == "R":
        judge = False
        break
    if i % 2 == 0 and dance[i] == "L":
        judge = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def dance(s):
    for i in range(0,len(s)):
        d = i%2
        if d == 0 and s[i] == "L":
            return "No"
        if d == 1 and s[i] == "R":
            return "No"
    return "Yes"

s = input()
print(dance(s))

Submission status: Accepted

Solution code:
s = input()
#print(s)
s1 =set(list(s[0:len(s):2]))
s2 =set(list(s[1:len(s):2]))
ki = set(['R','U','D'])
gu = set(['L','U','D'])

#print(s1,s2)
if ki.issuperset(s1) and gu.issuperset(s2):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#input
S = input()

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

Submission status: Accepted

Solution code:
s=input()
i=0
for c in s:
    i+=1
    if i%2:
        if not(c=='R' or c=='U' or c=='D'):
            print("No")
            break
    else:
        if not(c=='L' or c=='U' or c=='D'):
            print("No")
            break
else: print("Yes")

Submission status: Accepted

Solution code:
s=input()
i=0
flag=1
for c in s:
    i+=1
    if i%2:
        if not(c=='R' or c=='U' or c=='D'):
            print("No")
            flag=0
            break
    else:
        if not(c=='L' or c=='U' or c=='D'):
            print("No")
            flag=0
            break
if flag: print("Yes")

Submission status: Accepted

Solution code:
str = input()
s = list(str)

#print(s)


for i in range(0,len(s)):
    l = s[i]
    a = 1
    if i%2 == 0 and l=='L':
            break

    elif i%2 ==1 and l=='R':
            break

    else:
        	a = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = list(input())

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

flag = True

for i in odd:
      if i == 'L':
            flag = False
            break
for j in even:
      if j =='R':
            flag = False
            break

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

Submission status: Accepted

Solution code:
S=input();print('Yes' if ('L' not in S[::2])  and ('R' not in S[1::2]) else 'No')