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(len(s)):
    if i % 2 == 1 and  s[i] == 'R':
        print("No")
        sys.exit()
    elif i % 2 == 0 and s[i] == 'L':
        print("No")
        sys.exit()
    

print("Yes")

Submission status: Accepted

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

# S = input()
# N, M = map(int, input().split())
# nums = list(map(int, input().split()))
# nums_2d = [list(map(int, input().split())) for _ in range(N)]


def main():
    S = input()

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

    easy = True
    for i, s in enumerate(S):
        if i %2 == 1:
            if s not in even:
                easy = False
        else:
            if s not in odd:
                easy = False

    print(['No', 'Yes'][easy])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
def ki(tap):
    for i in range(0,len(tap),2):
        if tap[i]=='L':
            return 'No'

def gu(tap):
    for i in range(1,len(tap),2):
        if tap[i]=='R':
            return 'No'

if ki(s)=='No' or gu(s)=='No':
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    s = input()
    l = len(s)
    flag = True

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

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

if s[0] in ['R','U','D']:
    pass
else:
    flag = False
            
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
kisuu = ['R', 'U', 'D']
guusuu = ['L', 'U', 'D']
for i in s[::2]:
    if i in kisuu:
        continue
    else:
        print('No')
        quit()
for j in s[1::2]:
    if j in guusuu:
        continue
    else:
        print('No')
        quit()
print('Yes')

Submission status: Accepted

Solution code:
s = list(input())

count = 0

for i in range(0,len(s)):
  sign = (i+1)%2
  if sign == 1 and s[i] == "L":
    count = 1
  elif sign == 0 and s[i] == "R":
    count = 1
    
if count == 1:
  ans = "No"
elif count == 0:
  ans = "Yes"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']
fl = True
ans = 'Yes'
for i in s:
  if fl:
    fl = False
    if kisu.count(i) == 0:
      ans = 'No'
      break
  else:
    fl = True
    if gusu.count(i) == 0:
      ans = 'No'
      break

print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()
for i, notes in enumerate(s):
    if i%2 == 1:
        if notes == 'R':
            print('No')
            sys.exit()
    else:
        if notes == 'L':
            print('No')
            sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
    cnt += 1
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(str(input()))
tmp=0
for i in range(0,len(s)):
            if i%2==0 and s[i]=='L':
                        tmp+=1
            if i%2!=0 and s[i]=='R':
                        tmp+=1
if tmp>=1:
            print('No')
if tmp==0:
            print('Yes')

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 != 0 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 & 1 == 0 and s[i] == "L":
        ans = "No"
        break
    elif i & 1 == 1 and s[i] == "R":
        ans = "No"
        break
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "L":
        print("No")
        flag = "unko"
    else:
        pass
elif amari == 0:
    for i in range (1, (int(n) // 2)+1):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    s = input()
    so = s[::2]
    se = s[1::2]
    if set(so) <= {"R", "U", "D"} and set(se) <= {"L", "U", "D"}:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
even = ('L','U','D')
odd = ('R','U','D')

step = (even,odd)
s = input()
for i in range(len(s)):
  c = s[i]
  if c in step[1- i%2]:
    continue
  else:
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

Solution code:
s=list(input())
count=0
for i in range(0,len(s),2):
    if s[i]=='L':
        count+=1

for j in range(1,len(s),2):
    if s[j]=='R':
        count+=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S=list(input())
def main():
    while True:
        for i in range(len(S)):
            if (i+1)%2==1:
                if S[i]!='R' and S[i]!='U' and S[i]!='D':
                    return 'No'
                    break
            else:
                if S[i]!='L' and S[i]!='U' and S[i]!='D':
                    return 'No'
                    break
                
        return 'Yes'

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
r = "R","U","D"
l = "L","U","D"


yes = True
for i in range(len(s)):
    if i%2==0 and s[i] not in r: # 奇数番目でrに無い
        yes = False
        break
    if i%2==1 and s[i] not in l: # 偶数番目でlに無い
        yes = False
        break
        
print("YNeos"[not yes::2])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

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

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
odd = s[::2]
even = s[1::2]
if 'L' in odd or 'R' in even:
    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")
            exit()
    else :
        if S[i] == "R" :
            print("No")
            exit()

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()

flag = 0

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

Submission status: Accepted

Solution code:
S = list(input())
odd, even = [], []
for i, v in enumerate(S):
    if i % 2 == 0:
        if v == "R" or v == "U" or v == "D":
            continue
        else:
            odd.append(v)
            break

    else:
        if v == "L" or v == "U" or v == "D":
            continue
        else:
            even.append(v)
            break

print("No") if odd or even else print("Yes")

Submission status: Accepted

Solution code:
S = list(input())
odd = []
even = []
for i, v in enumerate(S):
    if i % 2 == 0:
        if v == "R" or v == "U" or v == "D":
            pass
        else:
            odd.append(v)

    else:
        if v == "L" or v == "U" or v == "D":
            pass
        else:
            even.append(v)

if odd or even:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)):
  if (i+1)/2 != int((i+1)/2):
    if (s[i] == 'R') or (s[i] =='U') or (s[i] =='D'):
      pass
    else:
      print('No')
      exit()
  else:
    if (s[i] == 'L') or (s[i] =='U') or (s[i] =='D'):
      pass
    else:
      print('No')
      exit()
print('Yes')

Submission status: Accepted

Solution code:
s=list(input())
s_o = s[::2]
s_e = s[1::2]

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

for i in range(len(s_o)):
    if (s_o[i] not in od):
        print("No")
        exit()

for i in range(len(s_e)):
    if (s_e[i] not in ev):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

def main():
  for i, c in enumerate(input().strip(), 1):
    if (i%2 == 1 and c == 'L') or (i%2 == 0 and c == 'R'):
      print('No')
      return 
  print('Yes')

if __name__=='__main__':
  main()

Submission status: Accepted

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

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

if count == len_Tap:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
if all([x in ['R', 'U', 'D'] for x in S[::2]]) and all([x in ['L', 'U', 'D'] for x in S[1::2]]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

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

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

Submission status: Accepted

Solution code:
#python3

def f(array, ch):
    res = True
    for i in array:
        if i == ch:
            res = False
            break
    return res

def main():
    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 != 0]
    if f(odd, 'L') and f(even, 'R'):
        print('Yes')
    else:
        print('No')
main()

Submission status: Accepted

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

print(check)

Submission status: Accepted

Solution code:
s = input()

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

judge = True

for i in range(len(s)):
    if i%2 == 0:
        if s[i] in odd:
            pass
        else:
            judge = False
    
    else:
        if s[i] in even:
            pass
        else:
            judge = False


if judge:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

for i in range (0,len(S),2):
    if S[i] == "L":
        s = 1
        break

for i in range (1,len(S),2):
    if S[i] == "R":
        s = 1
        break

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

Submission status: Accepted

Solution code:
s = input()

a = list(filter(lambda v: v not in ['R', 'U', 'D'], s[0::2]))
b = list(filter(lambda v: v not in ['L', 'U', 'D'], s[1::2]))

print("Yes" if len(a) == len(b) == 0 else "No")

Submission status: Accepted

Solution code:
S = input()

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

flag = True
for i in range(len(S)):
    if (i + 1) % 2 == 0:
        if S[i] not in even:
            print("No")
            flag = False
            break
    else:
        if S[i] not in odd:
            print("No")
            flag = False
            break

if flag:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()
a = "Yes"
for i in range(len(S)):
    if (i+1) % 2 == 0 and S[i] in["L", "U", "D"]:

        pass
    elif (i+1) % 2 == 1 and S[i] in["R", "U", "D"]:

        pass
    else:
        a = "No"
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

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:
S=input()
tmp = [S[i] in 'RUD' for i in range(len(S))[::2]]+[S[j] in 'LUD' for j in range(len(S))[1::2]]
print('YNeos'[False in tmp::2])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc141/tasks/abc141_b

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

okOfOdd = len(odd - set(['R', 'U', 'D']))
okOfEven = len(even - set(['L', 'U', 'D']))

if okOfOdd == 0 and okOfEven == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

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

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

main()

Submission status: Accepted

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

for i in range(len(s)):
    if (i+1) % 2 == 0 and s[i] in ["L", "U", "D"]:
        pass
    elif (i+1) % 2 != 0 and s[i] in ["R", "U", "D"]:
        pass
    else:
        ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
odd=set(S[0::2])
even=set(S[1::2])
odd_=['R','U','D']
even_=['L','U','D']
flag=0
for i in odd:
    if i not in odd_:
        flag=1
for i in even:
    if i not in even_:
        flag=1
print('Yes' if flag==0 else 'No')

Submission status: Accepted

Solution code:
s = input()
a = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == 'R'or s[i] == 'U'or s[i] == 'D':
            a += 1

    elif s[i] == 'L'or s[i] == 'U'or s[i] == 'D':
        a += 1

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

Submission status: Accepted

Solution code:
S=list(input())

for i,j in enumerate(S):
    if i%2==0:
        
        if j=="R"or j=="U"or j=="D":
            
            continue
        else:
            print("No")
            break
    else:
        if j=="L"or j=="U"or j=="D":
            continue
        else:
            print("No")
            break
else:
    print("Yes")

Submission status: Accepted

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


def main():
    S = input()
    result = 'Yes'
    for i, s in enumerate(S):
        if i % 2 == 0:
            if s not in ['R', 'U', 'D']:
                result = 'No'
        else:
            if s not in ['L', 'U', 'D']:
                result = 'No'

    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

flag = True

for i in range(1,len(s)):
  if i%2!=0 and s[i] not in odd:#奇数
    flag = False
  if i%2==0 and s[i] not in even:#偶数
    flag = False
    
if flag==True: print('Yes')
else: print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
s = input()

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

Submission status: Accepted

Solution code:
s=input()
r=[]
l=[]
for i,v in enumerate(s):
    if i%2==0:
        r.append(v)
    else:
        l.append(v)
if "L" in r or "R" in l:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

flg = 0

for i in range(len(s)):
    if i % 2 == 0 and (s[i] != "R" and s[i] != "U" and s[i] != "D"):
        flg = 1
    elif i % 2 == 1 and (s[i] != "L" and s[i] != "U" and s[i] != "D"):
        flg = 1
    else:
        continue

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=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:
S=input()
odd=[]
even=[]

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

    else:
        even.append(S[i])

if 'L' in odd or 'R' in even:
    print('No')

else:
    print('Yes')

Submission status: Accepted

Solution code:
s=list(input())
flag=True
for i in range(1,len(s)+1):
    v=s[i-1]
    if i%2==0:
        if v=="L" or v=="U" or v=="D":
            pass
        else:
            flag=False
            break
    else:
        if v=="R" or v=="U" or v=="D":
            pass
        else:
            flag=False
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
i = 0
while True and i < len(s):
  # 奇数文字目
  if (i+1) % 2 == 1:
    if s[i] == "L":
      print("No")
      break
  # 偶数文字目
  if (i+1) % 2 == 0:
    if s[i] == "R":
      print("No")
      break
  if i == len(s)-1:
    print("Yes")
  i += 1

Submission status: Accepted

Solution code:
s = input()
check = 0
for i in range(len(s)):
  # 奇数文字目
  if (i+1) % 2 == 1:
    if s[i] == "L":
      check += 1
  # 偶数文字目
  if (i+1) % 2 == 0:
    if s[i] == "R":
      check += 1
      
if check == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = list(input())

import collections

c_odds = collections.Counter(s[::2])
c_even = collections.Counter(s[1::2])

if 'L' not in c_odds.keys() and 'R' not in c_even.keys():
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
a = 0
n = len(s)

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

Submission status: Accepted

Solution code:
print(['No', 'Yes'][[(i[::2].count('L')==0)&(i[1::2].count('R')==0) for i in [input()]][0]])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

for i in range(M):
  if i % 2 == 0:
    if N[i] == "L":
      flag = False
  else:
    if N[i] == "R":
      flag = False
if flag == False:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
S = str(input())

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

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

Submission status: Accepted

Solution code:
S=input()
Ans="Yes"
even=[i for i in range(len(S)) if i % 2 == 0 ]

for j in even:
    if S[j]=="L":
        Ans="No"
    else:
        pass

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

for j in odd:
    if S[j]=="R":
        Ans="No"
    else:
        pass

print(Ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

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

print("Yes")

Submission status: Accepted

Solution code:
s = str(input())#L  R
count = 0

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

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

Submission status: Accepted

Solution code:
s = input()
on = "RUD"
oe = "LUD"

cnt = 0
for i in range(len(s)):
    if(i%2 == 0 and s[i] in on):
        cnt += 1
    elif(i%2 != 0 and s[i] in oe):
        cnt += 1
    
print("Yes" if cnt == len(s) else "No")

Submission status: Accepted

Solution code:
S=input()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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
            break
    else:
        if s[i] == "R":
            flag = False
            break
if flag == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

ans = True
for i in range(len(s)):
    if (i+1) % 2 == 0:
        if not(s[i] in ["L", "U", "D"]):
            ans = False

    else:
        if not(s[i] in ["R", "U", "D"]):
            ans = False

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

Submission status: Accepted

Solution code:
S = input()
a = map(lambda x:x in {"L","U","D"},S[1::2])
b = map(lambda x:x in {"R","U","D"},S[0::2])
print("Yes" if sum(a)+sum(b)==len(S) else "No")

Submission status: Accepted

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