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
s = input()
for i in range(0,len(s),2):
    if s[i]=="L":
        print("No")
        sys.exit()
for i in range(1,len(s),2):
    if s[i]=="R":
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()


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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ss =  input()

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

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

Submission status: Accepted

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

s = input().strip()

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

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

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


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


print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S=input()
flg=0

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# 文字列の入力
s = input()
# 出力
char_list = list(s)
count = 0
result = True

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



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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Tap Dance
S = input()

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

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

Submission status: Accepted

Solution code:
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

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

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = input()
isOdd = True
isEasy = True
for char in S:
    if isOdd:
        if (char == 'L'):
            isEasy = False
            break
    else:
        if (char == 'R'):
            isEasy = False
            break
    isOdd = not isOdd
print('Yes' if isEasy else 'No')

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

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
      break
  else:
    if (S[i] == 'R'):
      flag = 1
      break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = input()

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

print('Yes')

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
S = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

false_char = 'L'
easy = True

for s in S:
	if s == false_char:
		easy = False
		# print(s, 'false!')
		break

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = 0
for i in range(len(s)):
    if i%2 == 0 and s[i] == "L":flag=1
    if i%2 == 1 and s[i] == "R":flag=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
s1=[i for i in s[::2] if i=='R' or i=='U' or i=='D']
s2=[i for i in s[1::2] if i=='L' or i=='U' or i=='D']
if len(s1)==len(s[::2]) and len(s2)==len(s[1::2]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

S_odd = S[::2]
S_even = S[1::2]
if 'L' in S_odd or 'R' in S_even:
  print("No")
else:
  print("Yes")

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
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=input()
for o in S[::2]:
  if o not in 'RUD':
    print('No')
    exit()
for e in S[1::2]:
  if e not in 'LUD':
    print('No')
    exit()
print('Yes')

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# coding: UTF-8


#import scipy.optimize
#import numpy as np

    
##################################################################

if __name__ == "__main__":

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

inputs = input()

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = list(input())
for i in range(len(s)):
  if i%2: #偶数番目
    #print(s[i],i)
    if s[i] == 'R':
      print('No')
      sys.exit()
  if not i%2: #奇数番目
    #print(s[i],i)
    if s[i] == 'L':
      print('No')
      sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# input=sys.stdin.readline
def resolve():
    s=input()
    flag=True
    for i in range(len(s)):
        if i%2==0 and s[i]=='L':
            flag=False
        elif i%2==1 and s[i]=='R':
            flag=False
    print("Yes" if flag else "No")

resolve()

Submission status: Accepted

Solution code:
odd_tap = ['R', 'U', 'D']
# odd_tap = 'RUD'
even_tap = ['L', 'U', 'D']


def main():
    S = input()

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

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

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

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

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

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

flg = 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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




if __name__ == '__main__':
    ans()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

S = input()

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

print(ok)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = list(input())

X = "Yes"

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

print(X)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()
#print(s)
i=0
r=1
l=1
for c in s:
#  print(c)
  if i%2==0:
    if c=='L':
      r=0
  if i%2==1:
    if c=='R':
      l=0
  i+=1
if l==1 and r==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
s = input()


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


is_easy = True

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

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

Submission status: Accepted

Solution code:
import sys

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

ans="Yes"

ki=0
gu=0
if len(s)%2==0:
  ki=len(s)//2
  gu=len(s)//2
else:
  ki=(len(s)//2)+1
  gu=len(s)//2
#print(ki)
#print(gu)
for i in range(ki):
  if s[2*i] == "L":
    ans="No"

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

num = len(S)
flag = False
for i in range(num):
    s = S[i]
    if i%2 == 0:
        if s ==  'R' or s ==  'U' or s ==  'D':
            continue
        else:
            flag = True
            break
    else:
        if s ==  'L' or s ==  'U' or s ==  'D':
            continue
        else:
            flag = True
            break

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

Submission status: Accepted

Solution code:
s = list(input())
odd_s = ["R", "U", "D"]
even_s = ["L", "U", "D"]

ans = "Yes"

for i in range(len(s)):
  if i % 2 == 0:
    if s[i] not in odd_s:
      ans = "No"
  
  if i % 2 == 1:
    if s[i] not in even_s:
      ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = input()

print('Yes' if re.fullmatch(r'([RUD][LUD])*[RUD]?', S) else 'No')

Submission status: Accepted

Solution code:
def main():
    S = input().strip()

    cnt = 0
    flag = True
    Set_1 = {"R","U","D"}
    Set_2 = {"L","U","D"}
    for s in S:
        cnt += 1
        if cnt % 2 == 0 and s in Set_2:
            continue
        elif cnt % 2 == 1 and s in Set_1:
            continue
        else:
            flag = False
    
    if flag == True:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S=input()
i=0
for s in S:
    i+=1
    if i%2==1 and s=="L":
        print("No")
        sys.exit()
    elif  i%2==0 and s=="R":
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
 
N = len(S)
 
Ans = 1
 
for i in range(N):
  nTmp = (i+1) % 2
  
  if nTmp == 1 and S[i]=='L':
    Ans = 0
  if nTmp == 0 and S[i]=='R':
    Ans = 0
 
if Ans == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

def solve():
    S = input()
    for i in range(len(S)):
        if (i+1)%2 == 0:
            # 偶数
            if S[i] in ("L", "U", "D"):
                continue
            else:
                print("No")
                return
        else:
            # 奇数
            if S[i] in ("R", "U", "D"):
                continue
            else:
                print("No")
                return
    print("Yes")


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:

s = input()

#print(len(s))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
step = input()
flag = True
for i,s in enumerate(step):
	if s=='U' or s=='D':
		continue
	elif i%2!=0:
	#even
		if s=='L':
			continue
		else:
			flag = False
	else:
		if s=='R':
			continue
		else:
			flag = False
if flag:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
yes = 'Yes'
no = 'No'

S = input()

def main():
  checker = [odd, even]
  i=0
  for s in S:
    if not s in checker[i]:
      print(no)
      return
    i = 1 - i
  print(yes)
  return

main()

Submission status: Accepted

Solution code:
s = str(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:
S = input()
f1 = all(s in 'RUD' for s in S[::2])
f2 = all(s in 'LUD' for s in S[1::2])
print('Yes' if f1 and f2 else 'No')

Submission status: Accepted

Solution code:
S = input()

kisuu = S[::2]
gusuu = S[1::2]

flg = False

k_c = kisuu.count('R') + kisuu.count('U') + kisuu.count('D')
g_c = gusuu.count('L') + gusuu.count('U') + gusuu.count('D')

if k_c == len(kisuu) and g_c == len(gusuu):
    flg = True
  
if flg:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

answer = "Yes"
for i, c in enumerate(s):
    if 0 == i % 2:
        if 'R' != c and 'U' != c and 'D' != c:
            answer = "No"
            break
    else:
        if 'L' != c and 'U' != c and 'D' != c:
            answer = "No"
            break
print(answer)

Submission status: Accepted

Solution code:
b = input()
rud_list = ['R','U','D']
lud_list = ['L','U','D']
flg = True

for idx,i in enumerate(b):
    if (idx + 1)%2 ==0 and (i not in lud_list):
        print('No')
        flg = False
        break
    elif (idx + 1)%2 == 1 and (i not in rud_list):
        print('No')
        flg = False
        break
    else:
        pass
        
if flg:
    print('Yes')

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    S = input()

    easyflg = True
    for i in range(len(S)):
        if (i+1) % 2 == 0:
            if S[i] != "L" and S[i] != "U" and S[i] != "D": 
                easyflg = False
        else:
            if S[i] != "R" and S[i] != "U" and S[i] != "D": 
                easyflg = False

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

S = input().strip()

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

print(ans)

Submission status: Accepted

Solution code:
s = input();

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


cnt = 0
for i in range(len(s)):
    if ((i+1) % 2 == 0) and (s[i] in even):
        cnt += 1
    elif ((i+1) % 2 == 1) and (s[i] in odd):
        cnt += 1

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