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:
odd_steps = ['R', 'U', 'D']
even_steps = ['L', 'U', 'D']

S = input()

flg = 1
for i in range(len(S)):
    if (i + 1) % 2 == 1:
        if S[i] not in odd_steps:
            flg = 0
            break
    if (i + 1) % 2 == 0:
        if S[i] not in even_steps:
            flg = 0
            break

print('Yes') if flg == 1 else print('No')

Submission status: Accepted

Solution code:
s = str(input())
i = 0
count = 0
while(i < len(s)):
    if((i+1)%2 == 0 and s[i] == 'R'):
        count += 1
    if((i+1)%2 == 1 and s[i] == 'L'):
        count += 1
    i += 1
if(count == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())

if "L" in s[::2]:
    print("No")
    exit()

if "R" in s[1::2]:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

SA = S[0::2]
SB = S[1::2]
c =0

A = ["R","U","D"]
B = ["L","U","D"]

for i in SA:
  if i in A:
    continue
  else:
    c =1
    break
      
for i in SB:
  if i in B:
    continue
  else:
    c =1
    break
    
if c == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
S = list(map(str, input()))

bool = True
i = 0
while i != len(S):
    if i%2 == 0 and S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
        bool = True
        i += 1
    elif i%2 == 1 and S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
        bool = True
        i += 1
    else:
        bool = False
        i = len(S)
        
if bool:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
st = 0

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

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

Submission status: Accepted

Solution code:
S = input()
Mylist = list(S)
Rlist = ["R","U","D"]
Llist = ["L","U","D"]
ANSlist = []
for i in range(1,len(Mylist)+1):
    if i%2 == 1:
        if Mylist[i-1] in Rlist:
            ANSlist.append("Y")
    if i%2 == 0:
        if Mylist[i-1] in Llist:
            ANSlist.append("Y")

if len(ANSlist) == len(Mylist):
    
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
s = input()
for i,j in enumerate(s):
    if i%2 == 0:
        if not j in 'RUD':
            print('No')
            sys.exit()
    else:
        if not j in 'LUD':
            print('No')
            sys.exit()
print('Yes')

Submission status: Accepted

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

flag = 0

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

if flag > 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==0 and s[i]=="R":
        ans="No"
        break
    if (i+1)%2==1 and s[i]=="L":
        ans="No"
        break

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC 141: B – Tap Dance
s = input()

easily_odd_position = 'RUD'
easily_even_position = 'LUD'
is_easily = 'Yes'

for idx in range(len(s)):
    if s[idx] == 'R' and idx %2 == 1:
        is_easily = 'No'
    elif s[idx] == 'L' and idx % 2 == 0:
        is_easily = 'No'

print(is_easily)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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


YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S):
    N = len(S)
    for i in range(0, N, 2):
        if S[i] not in "RUD":
            return False

    for i in range(1, N, 2):
        if S[i] not in "LUD":
            return False

    return True


def main():
    S = input()
    if solve(S):
        print(YES)
    else:
        print(NO)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
n = N // 2
ans = 'Yes'
for i in range(n):
    p = S[2*i]
    q = S[2*i+1]
    if p == 'L':
        ans = 'No'
    if q == 'R':
        ans = 'No'
if N % 2 == 1:
    if S[N-1] == 'L':
        ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(input())

for i in range(len(li)):
    if i % 2 == 1:
        if li[i] == "R":
            print("No")
            quit()
        else:
            continue
    else:
        if li[i] == "L":
            print("No")
            quit()
        else:
            continue
print("Yes")

Submission status: Accepted

Solution code:
# 2019-11-18 17:34:23(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# import re
# import heapq
# import array
# from scipy.misc import comb # (default: exact=False)
# import numpy as np 

odd_position = 'RUD'
even_position = 'LUD'

def main():
    s = 'S' + sys.stdin.readline().rstrip() # S: no meaning
    for i in range(1, len(s)-1+1):
        if i % 2 != 0:
            if s[i] in odd_position:
                continue
            else:
                ans = 'No'
                break
        else:
            if s[i] in even_position:
                continue
            else:
                ans = 'No'
                break
    else:
        ans = 'Yes'
    
    print(ans)
     


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#LRUD
#odd rud
#even lud
a = input()
for i in range(len(a)):
    if i%2 == 0:
        if a[i] == "L":
            print("No")
            quit()
    else:
        if a[i] == "R":
            print("No")
            quit()
print("Yes")

Submission status: Accepted

Solution code:
S = list(input())
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
S_even = S[::2]
S_odd = S[1::2]
ans = True
for i in range(len(S_even)):
    if not S_even[i] in odd:
        ans = False

for j in range(len(S_odd)):
    if not S_odd[j] in even:
        ans = False

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

Submission status: Accepted

Solution code:
S = list(input())
ki = ["R","U","D"]
gu = ["L","U","D"]
for i in range(len(S)):
    tmp = S[i]
    if (i+1) % 2 == 1:
        if "R" == tmp or "U" == tmp or "D" == tmp:
            continue
        print("No")
        exit()
    else:
        if "L" == tmp or "U" == tmp or "D" == tmp:
            continue
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
s=input()
l=list(s)
lo=[]
le=[]
oc={'R','U','D'}
ec={'L','U','D'}
for i in range(len(s)):
    if i%2==0:
        lo.append(s[i])
    else:
        le.append(s[i])
if oc|set(lo)==oc and ec|set(le)==ec:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re


def inpl():
    return list(map(int, input().split()))


S = input()

p = re.compile(r'^([^L][^R])*[^L]?$')

if p.match(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import re


def inpl():
    return list(map(int, input().split()))


S = input()

p = re.compile(r'([^L][^R])*[^L]?$')

if p.match(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


S = input()

flag = True
for i in range(len(S)):
    if i % 2 == 0 and S[i] in 'RUD':
        continue
    elif i % 2 == 1 and S[i] in 'LUD':
        continue
    flag = False

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

Submission status: Accepted

Solution code:
S = input()

if set(S[::2]) <= set("RUD") and set(S[1::2]) <= set("LUD"):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if flag:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
#141
s = input()
a = True

for i in range(len(s)):
    if (i+1)%2==0:
        if s[i]!='L' and s[i]!='U' and s[i]!='D':
            a = False
            break
    else:
        if s[i]!='R' and s[i]!='U' and s[i]!='D':
            a = False
            break

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    cnt = True
     
    l_num = s.count('L')
    r_num = s.count('R')
    u_num = s.count('U')
    D_num = s.count('D')
    
    for i in range( len(s) ):
      if s[i] == 'L' and i % 2 == 0:
        cnt = False
      if s[i] == 'R' and i % 2 == 1:
        cnt = False
    
    if cnt == True:
      print("Yes")
    else:
      print("No")
      
if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
play = True
s = input()

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

Submission status: Accepted

Solution code:
S=input()
k=['R','U','D']
g=['L','U','D']
t=0
for i in S[0::2]:
    pr=[pr for pr in k if pr==i] 
    if pr==[]:
        print('No')
        t=1
        break

if t==0:
    for i in S[1::2]:
        pr=[pr for pr in g if pr==i] 
        if pr==[]:
            print('No')
            t=1
            break
if t==0:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
flag=1
for i,x in enumerate(S):
    if (i+1) % 2 == 0:
        if x =='R':
            flag =0
    else:
        if x =="L":
            flag =0
if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
for s in S[0:len(S):2]:
    if s == 'L':
        print('No')
        exit(0)

for s in S[1:len(S):2]:
    if s == 'R':
        print('No')
        exit(0)
        
print('Yes')

Submission status: Accepted

Solution code:
S=input()
oddLst=['R','U','D']
evenLst=['L','U','D']

ret='Yes'
cnt=0
for s in S:
    cnt+=1
    if(cnt%2):
        if s in oddLst:
            continue
        else:
            ret='No'
    else:
        if s in evenLst:
            continue
        else:
            ret='No'

print(ret)

Submission status: Accepted

Solution code:
S = input()
for_num = 0

for i in S:
  for_num += 1
  if for_num % 2 == 0 and i == "R":
      print("No")
      break
  elif for_num % 2 != 0 and i == "L":
      print("No")
      break
  elif for_num == len(S):
    print("Yes")

Submission status: Accepted

Solution code:
s=str(input())
even = ["L","U", "D"]
odd = ["R", "U", "D"]
a = []
b = []
for i in range(len(s)):
     if (i+1)%2 == 0:
            if s[i] in even:
                a.append(True) 
            else:
                a.append(False)
     elif (i+1)%2 != 0:
            if s[i] in odd:
                b.append(True) 
            else:
                b.append(False)
if all(a) and all(b):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x = input()
count=0
for i in range(0,len(x),2):
  if x[i]=="R" or x[i]=="U" or x[i]=="D":
    count += 1
for j in range(1,len(x),2):
  if x[j]=="L" or x[j]=="U" or x[j]=="D":
    count += 1
if count==len(x):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = list(input())
even = s[::2]
odd = s[1::2]
even_ok = "L" not in even
odd_ok  = "R" not in odd

print("Yes" if even_ok and odd_ok else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
input = sys.stdin.readline


def main():
    sc = Scan()
    s = sc.strarr()[0]

    index = 0
    for c in s:
        if index % 2 == 0 and c == 'L':
            print('No')
            exit()
        if index % 2 == 1 and c == 'R':
            print('No')
            exit()
        index += 1
    print('Yes')


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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

Submission status: Accepted

Solution code:
s=list(input())
sw=False
for i in range(len(s)):
  if i%2==0:
    if not(s[i]=="R" or s[i]=="U" or s[i]=="D"):
      sw=True
  elif i%2==1:
    if not(s[i]=="L" or s[i]=="U" or s[i]=="D"):
      sw=True

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

Submission status: Accepted

Solution code:
S = input()
for i, c in enumerate(S):
    if i % 2 == 0:
        if c not in {"R", "U", "D"}:
            print("No")
            quit()
    else:
        if c not in {"L", "U", "D"}:
            print("No")
            quit()

print("Yes")

Submission status: Accepted

Solution code:
S = input()
not_odd = 'L'
not_even = 'R'

ans = 'Yes'
count = 1
for i in range(len(S)):
    if count % 2 == 1 and S[i] == not_odd:
        ans = 'No'
        break
    elif count % 2 == 0 and S[i] == not_even:
        ans = 'No'
        break

    count += 1

print(ans)

Submission status: Accepted

Solution code:
S = str(input())

odd = True
even = True
for i in range(len(S)):
  if i%2 == 0: # odd
    if S[i] not in ["R", "U", "D"]:
      odd = False
      print("No")
      exit()
  else: # even
    if S[i] not in ["L", "U", "D"]:
      even = False
      print("No")
      exit()
      
print("Yes")

Submission status: Accepted

Solution code:
S = input()

odd_number = []
even_number = []

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

correct = 0
        
for j in range(len(odd_number)):
    if odd_number[j] != "L":
        correct += 1

for k in range(len(even_number)):
    if even_number[k] != "R":
        correct += 1
    
if correct == len(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
n = list(input())
for idx, i in enumerate(n, 1):
  if idx%2!=0:
    if i == 'L':
      print('No')
      exit()
  else:
    if i == 'R':
      print('No')
      exit()
print('Yes')

Submission status: Accepted

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

od=set([s[x] for x in range(0,N,2)])
ev=set([s[x] for x in range(1,N,2)])

if ('R' in ev) or ('L' in od):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
list_A=[]
for letter in S:
    list_A.append(letter)
list_B=list_A[0::2]
list_C=list_A[1::2]
b=0
c=0
for letter2 in list_B:
    if letter2=='R'or letter2=='U'or letter2=='D':
        b+=1
for letter3 in list_C:
    if letter3=='L'or letter3=='U'or letter3=='D':
        c+=1
if b==len(list_B)and c==len(list_C):
        print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
flag = "Yes"
even = {"R","U","D"}
odd = {"L","U","D"}
N = len(S)
for i in range(N):
  if i%2 == 0 and S[i] in even:
    continue
  elif i%2 == 1 and S[i] in odd:
    continue
  else:
    flag = "No"
    break
print(flag)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

for i, s in enumerate(S):
  i = i + 1
  if (i % 2 == 0 and s == 'R') or (i % 2 == 1 and s == 'L'):
    print("No")
    break
else:
  print("Yes")

Submission status: Accepted

Solution code:
S = input()

is_easy = True
for s in S[0::2]:
    if s != 'R' and s != 'U' and s != 'D':
        is_easy = False
        break

if is_easy:
    for s in S[1::2]:
        if s != 'L' and s != 'U' and s != 'D':
            is_easy = False
            break

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

Submission status: Accepted

Solution code:
for i, s in enumerate(input(), start=1):
  if i % 2 == 1 and s in 'RUD':
    continue
  elif i % 2 == 0 and s in 'LUD':
    continue
  else:
    print('No')
    exit()
else:
  print('Yes')

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    s = str(readline().rstrip().decode('utf-8'))
    b = True
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] not in list("RUD"):
                b = False
                break
        else:
            if s[i] not in list("LUD"):
                b = False
                break
    print("Yes" if b else "No")



if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
w=input()
o=["R","U","D"]
e=["L","U","D"]
ans="Yes"
for i in w[::2]:
    if i not in o:
        ans="No"
for i in w[1::2]:
    if i not in e:
        ans="No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();print('YNeos'[(sum( (i%2==0 and s[i] not in 'RUD') or (i%2!=0 and s[i] not in 'LUD') for i in range(len(s))))>0::2])

Submission status: Accepted

Solution code:
s = [i for i in input()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
import re
def print_ans(input_line):
    """Test Case
    >>> print_ans("RUDLUDR")
    Yes
    >>> print_ans("DULL")
    No
    >>> print_ans("UUUUUUUUUUUUUUU")
    Yes
    >>> print_ans("ULURU")
    No
    >>> print_ans("RDULULDURURLRDULRLR")
    Yes
    """
    odd = input_line[::2]
    even = input_line[1::2]
    # print(re.search(r'L',odd) ,re.search(r'R',even))
    if re.search(r'L', odd) == None and re.search(r'R',even) == None:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    s = input().rstrip()
    print_ans(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

a='Yes'
for i in range(len(s)):
  if (i+1)%2 ==1:
    if s[i] not in ['R', 'U', 'D']:
      a='No'
      break
  else:
    if s[i] not in ['L', 'U', 'D']:
      a ='No'
      break

print(a)

Submission status: Accepted

Solution code:
import math
S = input()
N = len(S)
count = 0
for i in range(N//2):
    if S[2 * i] != 'L' and S[2 * i + 1] != 'R':
        count += 2
    else:
        break
if N % 2 == 1:
    if S[N - 1] != 'L':
        count += 1
if count == N:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
odd = ['R','U','D']
even = ['L','U','D']
ans = 'Yes'

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

Submission status: Accepted

Solution code:
dic = [{'L':1, 'R':0, 'U':1, 'D':1},{'L':0, 'R':1, 'U':1, 'D':1}]
s = input()
ans = 1
for i ,key in enumerate(s):
  ans = ans*(dic[(i+1)%2][key])
print('YNeos'[not(ans)::2])

Submission status: Accepted

Solution code:
s = str(input())

res = 'Yes'
for i in range(0, len(s), 2):
    if s[i] == 'L':
        res = 'No'
    
for i in range(1, len(s), 2):
    if s[i] == 'R':
        res = 'No'

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
ans = "Yes"
for i,s in enumerate(S,1):
    if i % 2:
        if s not in "RUD":
            ans = "No"
            break
    else:
        if s not in "LUD":
            ans = "No"
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

is_danceable_odd = all([s[i] != 'L' for i in range(n) if i % 2 == 0])
is_danceable_even = all([s[i] != 'R' for i in range(n) if i % 2 == 1])
is_danceable = is_danceable_odd and is_danceable_even

if is_danceable:
	print('Yes')
else:
	print("No")

Submission status: Accepted

Solution code:
import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


# A
def A():
    s = input()
    if s == "Sunny":
        print("Cloudy")
    elif s == "Cloudy":
        print("Rainy")
    else:
        print("Sunny")
    return


# B
def B():
    s = S()
    for i in range(len(s)):
        if i % 2:
            if s[i] not in ["L", "U", "D"]:
                print("No")
                return
        else:
            if s[i] not in ["R", "U", "D"]:
                print("No")
                return
    print("Yes")
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    B()
    return


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

Submission status: Accepted

Solution code:
S=input()
s=list(S)
 
odd=[]
even=[]
 
for i in range(len(s)):
  if i%2==0:
    odd.append(s[i])
  if i%2==1:
    even.append(s[i])
 
    
oddsum=0
evensum=0
 
for i in range(len(odd)):
  if odd[i]=="R" or odd[i]=="U" or odd[i]=="D":
    oddsum+=1
  else:
    oddsum+=0
 
for i in range(len(even)):
  if even[i]=="L" or even[i]=="U" or even[i]=="D":
    evensum+=1
  else:
    evensum=0
 
if oddsum==len(odd) and evensum==len(even):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = list(input())
if 'L' in S[::2] or 'R' in S[1::2]:
    print('No')
    exit()
for i in S:
    if i != 'L' and i != 'R' and i != 'U' and i != 'D':
        print('No')
        exit()
print('Yes')