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:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

s = ns()

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

Submission status: Accepted

Solution code:
S = list(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:
import sys

S = str(input())
Smax = len(S)

for i in range(0, Smax, 2) :
  if S[i] == "L" :
    print("No")
    sys.exit()
  else :
    continue

for i in range(1, Smax, 2) :
  if S[i] == "R" :
    print("No")
    sys.exit()
  else :
    continue

print("Yes")

Submission status: Accepted

Solution code:
S = input()
isEasy = True
for i, char in enumerate(S):
    if char == "L":
        if i % 2 == 1: continue
        else:
            isEasy = False
            break
    elif char == "R":
        if i % 2 == 0: continue
        else:
            isEasy = False
            break
judge = "Yes" if isEasy else "No"
print(judge)

Submission status: Accepted

Solution code:
a = str(input())
ans=0
i=0
for aa in a:
  i +=1
  if i%2 == 0:
    if  aa !='L' and aa !='U' and aa != 'D':
      ans=1
  else :
    if  aa !='R' and aa !='U' and aa != 'D':
      ans=1
if ans == 0 :
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

S_E = S[1::2]

S_O = S[::2]

S_E_ans = "R" in S_E

S_O_ans = "L" in S_O

if S_E_ans == 0 and S_O_ans == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt=1
flag=1

#S2 = list(map(str, S))
#print(S)
for s in S:
    if(cnt%2==0):
#        print("a",s)
        if not(s=='L' or s=='U' or s=='D'):
            flag=0
        cnt+=1
    else:
        if not(s=='R' or s=='U' or s=='D'):
#            print("b",s)
            flag=0
        cnt+=1
#    print("cnt",cnt)
            
if(flag==1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

flag = True


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

    else:
        if(s[i] == 'R' or s[i] == 'U' or s[i] == 'D'):
           pass
        else:
            flag = False


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    S  = input()
    O_flag = 0
    E_flag = 0
    for i in range(0, len(S),2):
        if S[i]!="R" and S[i]!="U" and S[i]!="D":
            O_flag = 1
            break
    for i in range(1, len(S),2):
        if S[i]!="L" and S[i]!="U" and  S[i]!="D":
            E_flag = 1
            break
    if O_flag ==1 or E_flag ==1:
        print("No")
    else:
        print("Yes")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = list(input())
flag = True
for i, fs in enumerate(s):
    i += 1
    if not((i%2 == 0 and fs in ("L","U","D")) or (i%2 == 1 and fs in ("R","U","D"))):
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=list(input())
count=0
for i in range(len(S)):
  c=i%2
  if c==0 and S[i]=="L":
    count +=1
    
  elif c==1 and S[i]=="R":
    count +=1
  
  else:
    next
if count==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
evenpool = "RUD"
oddpool = 'LUD'
n = len(s)
for i in range(n):
    if i % 2 == 0 and s[i] not in evenpool:
        print("No")
        break
    elif i % 2 == 1 and s[i] not in oddpool:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
x = sorted(set(s[::2]))
y = sorted(set(s[1::2]))
countx = 0
county = 0
for i in x:
    if i in 'RDU':
        countx += 1
for i in y:
    if i in 'LDU':
        county += 1
print('Yes' if countx==len(x) and county==len(y) else 'No')

Submission status: Accepted

Solution code:
S=input()

s=1

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

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

Submission status: Accepted

Solution code:
s = input()
judge = True

for i in range(len(s)):
	if (i+1) % 2 != 0:
		if s[i] == "R" or s[i] == "U" or s[i] == "D":
			continue
		else:
			judge = False
			break
	else:
		if  s[i] == "L" or s[i] == "U" or s[i] == "D":
			continue
		else:
			judge = False
			break

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

Submission status: Accepted

Solution code:
S = list(input())

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

is_even = all(list(map(lambda x: x in even_list, S[0::2])))
is_odd = all(list(map(lambda x: x in odd_list, S[1::2])))

if is_even and is_odd:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=list(input())
k=[]
g=[]
kcount=0
gcount=0
for i in range(len(s)):
        if i%2==0:
                k.append(s[i])
                if s[i]=="R" or s[i]=="U" or s[i]=="D":
                        kcount+=1
        else:
                g.append(s[i])
                if s[i]=="L" or s[i]=="U" or s[i]=="D":
                        gcount+=1 

if len(k)==kcount and len(g)==gcount:
        print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
s = input()
s_even = s[1::2]
s_odd = s[::2]

counter = 0
for i in s_odd:
    if i == 'R' or i == 'U' or i == 'D':
        counter +=1
for i in s_even:
    if i == 'L' or i == 'U' or i == 'D':
        counter +=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

for i in range(len(S)):
    #i+1が奇数
    if i % 2==0:
        if S[i] == "L":
            print("No")
            break;
    else:
        if S[i] == "R":
            print("No")
            break;
    if(i==len(S)-1):
        print("Yes")

Submission status: Accepted

Solution code:
S = input()

if all([c in {'R', 'U', 'D'} for c in S[::2]]) and all([c in {'L', 'U', 'D'} for c in S[1::2]]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
O = set(S[::2])
E = set(S[1::2])
ans1 = [True if c in 'RUD' else False for c in O]
ans2 = [True if c in 'LUD' else False for c in E]
print('Yes' if False not in ans1 and False not in ans2 else 'No')

Submission status: Accepted

Solution code:
S=input()

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

even=set(even)
odd=set(odd)

#print(even,odd)

if even <= {"R","U","D"} and odd <= {"L","U","D"}:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

flag = 0

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

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

Submission status: Accepted

Solution code:
from sys import stdin

a = stdin.readline().rstrip()

b = ["R","U","D"]
c = ["L","U","D"]

for i in range(len(a)):
    if i % 2 == 0:
        if a[i] not in b:
            print("No")
            exit()      
    else:
        if a[i] not in c:
            print("No")
            exit() 
print("Yes")

Submission status: Accepted

Solution code:
import sys

S = input()

odd = S[0::2]
eve = S[1::2]


for o in odd:
    if o == "L":
        print("No")
        sys.exit()

for e in eve:
    if e == "R":
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
s = input()
n = s[1::2]
o = s[::2]
cnt = 0
r = set(list("DRU"))
l = set(list("DLU"))
if set(o) | r == r: cnt+=1
if set(n) | l == l: cnt+=1
if cnt==2: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
S = input()

even = set(S[1::2])
odd = set(S[::2])


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

Submission status: Accepted

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

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


for i in range(len(s)):
    if i%2==0 and s[i] in odd:
        a=a
    elif i%2==1 and s[i] in even:
        a=a
    else:
        a="No"
        break

print(a)

Submission status: Accepted

Solution code:
s = input()
count = 0

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

Submission status: Accepted

Solution code:
S=input()

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

print('Yes')

Submission status: Accepted

Solution code:
s=input()

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

print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = input()
tmp = "U"
S = tmp + S
N = len(S)

for i in range(N):
    if i % 2 == 1:
        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()
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

flg = True
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] not in ['R', 'U', 'D']:
            flg = False
    else:
        if s[i] not in ['L', 'U', 'D']:
            flg = False

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
#show_flg=True

an=0
k=0
s=list(input())
n=len(s)
d=[['R','U','D'],['L','U','D']]
show(d[0],d[1])
for i in range(n):
    if s[i] in d[k]:
        show('OK')
    else:
        show('NG')
        an=1
    k=1-k
    
print(YN[an])

Submission status: Accepted

Solution code:
import numpy as np
step = input()
step = list(step)
a = 0


for i, j in enumerate(step):
  if (i+1)%2 == 0 and j == "R":
    a += 1
    print("No")
    break
  elif (i+1)%2 == 1 and j=="L":
    a +=1
    print("No")
    break

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

Submission status: Accepted

Solution code:
a=list(input())
ans=0
b=a[0::2]
c=a[1::2]
for i in range(len(b)):
  if b[i]!='L':
    ans+=1
for i in range(len(c)):
  if c[i]!='R':
    ans+=1
if ans==len(a):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=input()
i=0
a=""
while i<len(s):
  if s[i]=="L":
    a="No"
    break
  else:
    i+=2
if a=="No":
  pass
else:
  i=1
  while i<len(s):
    if s[i]=="R":
      a="No"
      break
    else:
      i+=2
if a=="":
  a="Yes"
print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def test():
    s = input()
    n = len(s)
    for i in range(0,n,2):
        if s[i] == "L":
            print("No")
            return
    for i in range(1,n,2):
        if s[i] == "R":
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
S = input()
error = 0

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

Submission status: Accepted

Solution code:
S = list(input())
a = len(S)
b = 0
c = 0
for i in range(a):
    if c==0:
        if b%2==0:
            b += 1
            if S[i]=="L":
                c += 1
        else:
            b += 1
            if S[i]=="R":
                c += 1

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

Submission status: Accepted

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

a = 0
for i in range(0,n,2):
  if lis[i] == "L":
    a+=1

for i in range(1,n,2):
  if lis[i] == "R":
    a+=1

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

Submission status: Accepted

Solution code:
import numpy as np

S = np.array(list(input()))

R = np.where(S == 'R')[0] + 1
L = np.where(S == 'L')[0] + 1

if (np.prod(R) % 2 == 1) * (np.sum(L % 2) == 0):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

easy = True
for s in S[0::2]:
  if s == 'L':
    easy = False

for s in S[1::2]:
  if s == 'R':
    easy = False

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

Submission status: Accepted

Solution code:
s = input()

od = ["R","U","D"]
ev = ["L","U","D"]

b = False
for i in range(len(s)):
  if i%2==1 and (s[i] not in ev):
      b = True
      break
  elif i%2==0 and (s[i] not in od):
      b = True
      break

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

Submission status: Accepted

Solution code:
s = input()

for i, si in enumerate(s):
    if i%2==0 and (si=="R" or si=="U" or si=="D"):
        pass
    elif i%2==1 and (si=="L" or si=="U" or si=="D"):
        pass
    else:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys

s = list(input())

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

print('Yes')

Submission status: Accepted

Solution code:
s = input()

a = 1
ans = 1

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

Submission status: Accepted

Solution code:
s = input().strip()
s1 = ["R", "U","D"]
s2 = ["L","U","D"]

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

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

print("Yes")

Submission status: Accepted

Solution code:
import collections
S = input()

even = collections.defaultdict(int)
odd = collections.defaultdict(int)

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

odd = list(odd.keys())
even = list(even.keys())

if "R" in odd:
    if odd.index("R") >= 0:
        odd.pop(odd.index("R"))
if "U" in odd:
    if odd.index("U") >= 0:
        odd.pop(odd.index("U"))
if "D" in odd:
    if odd.index("D") >= 0:
        odd.pop(odd.index("D"))

if len(odd) != 0:
    print("No")
    exit(0)

if "L" in even:
    if even.index("L") >= 0:
        even.pop(even.index("L"))
if "U" in even:
    if even.index("U") >= 0:
        even.pop(even.index("U"))
if "D" in even:
    if even.index("D") >= 0:
        even.pop(even.index("D"))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
kisuu = ['R', 'U', 'D' ]
gusuu = ['L', 'U', 'D' ]
ki = []
gu = []

for i in range(len(s)):
    if i % 2 != 0:
        gu.append(s[i])
    else:
        ki.append(s[i])

if set(gu).issubset(gusuu) and set(ki).issubset(kisuu):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input())

kisu = ['R', 'U', 'D']
guu = ['L', 'U', 'D']
check = 'Yes'
for i, st in enumerate(S):
		if (i + 1) % 2 == 0:
				if not st in guu:
						check = 'No'
		else:
				if not st in kisu:
						check = 'No'

print(check)

Submission status: Accepted

Solution code:
s = list(input())
flag = True
for i in range(len(s)):
    if i%2 == 0 and s[i] == 'L':#odd
        flag = False
        break
    elif i%2 == 1 and s[i] == 'R':
        flag = False
        break
    
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
tmp = input()
lis = list(tmp)
length = len(lis)
judge = 0
for i in range(0, length, 2):
    if lis[i] == 'L':
        judge = 1
for j in range(1, length, 2):
    if lis[j] == 'R':
        judge = 1

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

Submission status: Accepted

Solution code:
S = input()

odd = ('R', 'U', 'D')
even = ('L', 'U', 'D')

ans = 'Yes'
for i in range(1, len(S) + 1):
    if i % 2 == 1:
        if not S[i-1] in odd:
            ans = 'No'
            break
    else:
        if not S[i-1] in even:
            ans = 'No'
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 'Yes'
for i in range(len(S)):
    if (i+1)%2==1:
        if S[i:i+1] not in ['R', 'U', 'D']:
            ans = 'No'
            break
    else:
        if S[i:i+1] not in ['L', 'U', 'D']:
            ans = 'No'
            break
print(ans)

Submission status: Accepted

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

odd_list = ["R", "U", "D"]
even_list = ["L", "U", "D"]

ans = "Yes"
for i in range(len(S)):
    if (i + 1) % 2 == 0:
        if S[i] in even_list:
            continue
        else:
            ans = "No"
    else:
        if S[i] in odd_list:
            continue
        else:
            ans = "No"

print(ans)

Submission status: Accepted

Solution code:
s = list(input())

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

else :
    print('Yes')

Submission status: Accepted

Solution code:
s = list(input())

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

ans = "Yes"

if odd.count("L")>0:
    ans = "No"
if even.count("R")>0:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
odds = set(s[::2])
easy_odds = {'R', 'U', 'D'}
evens = set(s[1::2])
easy_evens = {'L', 'U', 'D'}
if odds <= easy_odds and evens <= easy_evens:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
Step = input()

easyStep = 'Yes'

for i in range(len(Step)):
    # odd
    if i % 2 == 0 and Step[i] == 'L':
        easyStep = 'No'
        break
    elif i % 2 == 1 and Step[i] == 'R':
        easyStep = 'No'
        break

print(easyStep)

Submission status: Accepted

Solution code:
N= list(input())

Kisuu = ['R', 'U', 'D']
Guusu = ['L', 'U', 'D']
flag = True

for i in range(len(N)):
#     print(i, N[i])
    if (i+1) % 2 != 0:
        if N[i] not in Kisuu:
            flag = False
    elif (i+1) % 2 == 0:
#         print(Guusu)
        if N[i] not in Guusu:
            flag = False
#     print(flag)

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

Submission status: Accepted

Solution code:
S = input()
cout = 'Yes'

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

print(cout)

Submission status: Accepted

Solution code:
n = input()
chars = list(n)

f = True
for i in range(len(chars)):
  if i % 2 == 0 and chars[i] == 'L':
    f = False
    break
  elif i % 2 == 1 and chars[i] == 'R':
    f = False
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
k = ["R", "U", "D"]
g = ["L", "U", "D"]
coun = 0
for i in range(1,len(s)+1):
  if i % 2 == 1 and s[i-1] == "L":
    break
  elif i % 2 == 0 and s[i-1]=="R":
    break
  coun += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
flg = True
for i, s in enumerate(S):
    if (i+1)%2==1 and s=='L':
        flg = False
        break
    elif (i+1)%2==0 and s=='R':
        flg = False
        break
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

list = list(s)

kisuu = list[0::2]
guusuu = list[1::2]

if "L" in kisuu or "R" in guusuu:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = list(input())

res = "Yes"

for index, value in enumerate(s):
    index += 1
    if index % 2 == 0:
        if value != 'L' and value != 'U' and value != 'D':
            res = "No"
            break
    else:
        if value != 'R' and value != 'U' and value != 'D':
            res = "No"
            break

print(res)

Submission status: Accepted

Solution code:
S = input()

for s in S[0::2]:
    if s != 'R' and s != 'U' and s != 'D':
        print('No')
        quit()

for s in S[1::2]:
    if s != 'L' and s != 'U' and s != 'D':
        print('No')
        quit()

print('Yes')

Submission status: Accepted

Solution code:
s = input()
s1 = s[::2]
s2 = s[1::2]
s1 = s1.replace('R','')
s1 = s1.replace('U','')
s1 = s1.replace('D','')
s2 = s2.replace('L','')
s2 = s2.replace('U','')
s2 = s2.replace('D','')
if s1 == '' and s2 == '':
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
guu = []
kis = []
for i in range(len(S)):
    if i%2 == 0:
        guu.append(S[i])
    else:
        kis.append(S[i])
if "L" in guu or "R" in kis:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
# coding: utf-8

if __name__ == "__main__":
    s = input()
    ud = set(['U', 'D'])
    o = list(set(s[0::2]) - ud)
    e = list(set(s[1::2]) - ud)
    if 'L' in o or 'R' in e: print("No")
    else: print("Yes")

Submission status: Accepted

Solution code:
oddPrevensionStep = "L"
evenPrevensionStep = "R"

count = 1
dance = True
for h in input():
    if (0 == count % 2):
        if (h == evenPrevensionStep):
            dance &= False
    else:
        if (h == oddPrevensionStep):
            dance &= False
    count += 1


if (dance):
    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':
        print('No')
        exit()
    if i % 2 == 1 and S[i] == 'R':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
steps = raw_input()

a = ['R', 'L']

yes = True
for i in xrange(len(steps)):
    if steps[i] == a[(i + 1) % 2]:
        yes = False
        break



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

Submission status: Accepted

Solution code:
import sys

S = input()
check = ["R", "U", "D"]
for s in list(S):
    if not s in check:
        print("No")
        sys.exit()
    if check[0] == "R":
        check[0] = "L"
    else:
        check[0] = "R"
print("Yes")

Submission status: Accepted

Solution code:
S = input()

ans = 0

for i in range(len(S)):
  if i % 2 == 0:
    if S[i] in ["R", "U", "D"]:
      ans += 0
    else:
      ans += 1
      
  if i % 2 == 1:
    if S[i] in ["L", "U", "D"]:
      ans += 0
    else:
      ans += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
S_k = S[0::2]
S_g = S[1::2]
k_tf = ('L' in S_k)
g_tf = ('R' in S_g)
answer = k_tf + g_tf
if answer>=1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

for i in range(0, len(s), 2):
    if s[i] == "L":
        print("No")
        exit()

for i in range(1, len(s), 2):
    if s[i] == "R":
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
import numpy as np
import math
import subprocess
import random
import os
import sys


s=input()

nums=len(s)

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

if count==0:
	print('Yes')
else:
	print("No")

Submission status: Accepted

Solution code:
S = raw_input()
odd= set(['R', 'U', 'D'])
even= set(['L', 'U', 'D'])
def check(S):
    for i, ch in enumerate(S):
        if (i +1) % 2==0:
            #even
            if ch not in even:
                return False
        else:
            if ch not in odd:
                return False
    return True
easy= check(S)
if easy:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

size = len(s)
judge = 0
ki = ['R','U','D']
gu = ['L','U','D']


for i in range((size+1)//2):
    if s[i*2] not in ki:
        judge += 1

for i in range(size//2):
    if s[i*2+1] not in gu:
        judge += 1
        
if judge == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

l = list(input())

o = l[0::2]
e = l[1::2]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
l = len(S)
S_list = []
flag = False
for i in S:
    S_list.append(i)

for i in range(l):
    if i % 2 == 0 and S_list[i] == 'L':
        flag = True
    elif i % 2 == 1 and S_list[i] == "R":
        flag = True
    else:pass


if flag:
    print("No")

else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
def resolve():
    s = input()

    for i in range(len(s)):
        curr = s[i]
        if i % 2 == 0:
            if curr not in ["R", "U", "D"]:
                print("No")
                return
        else:
            if curr not in ["L", "U", "D"]:
                print("No")
                return
    print("Yes")
    
resolve()

Submission status: Accepted

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