Problem:


Score: 200 points

Problem Statement

Takahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.

S is said to be easily playable if and only if it satisfies both of the following conditions:

Every character in an odd position (1-st, 3-rd, 5-th, \ldots) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th, \ldots) is L, U, or D.

Your task is to print Yes if S is easily playable, and No otherwise.

Constraints

S is a string of length between 1 and 100 (inclusive).

Each character of S is L, R, U, or D.

Input

Input is given from Standard Input in the following format:

S

Output

Print Yes if S is easily playable, and No otherwise.

Sample Input 1

RUDLUDR

Sample Output 1

Yes

Every character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th) is L, U, or D.

Thus, S is easily playable.

Sample Input 2

DULL

Sample Output 2

No

The 3-rd character is not R, U, nor D, so S is not easily playable.

Sample Input 3

UUUUUUUUUUUUUUU

Sample Output 3

Yes

Sample Input 4

ULURU

Sample Output 4

No

Sample Input 5

RDULULDURURLRDULRLR

Sample Output 5

Yes



Sample input:
RUDLUDR


Sample output:
Yes

Submission status: Accepted

Solution code:
s = input()

for num, val in enumerate(s):
    if (num + 1) % 2 == 1:
        if val == "L":
            print("No")
            break
    else:
        if val == "R":
            print("No")
            break
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')
        exit()
    if i % 2 == 1 and s[i] == 'R':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


s = S()
ans = 'Yes'
for i in range(len(s)):
    # print(s[i])
    if i % 2 == 0 and s[i] in {'R', 'U', 'D'}:
        # print('goo even')
        continue
    elif i % 2 != 0 and s[i] in {'L', 'U', 'D'}:
        # print('goo odd')
        continue
    # print('no...')
    ans = 'No'
    break
print(ans)

Submission status: Accepted

Solution code:
a = ["R", "U", "D"]
b = ["L", "U", "D"]
s = input()
iscan = True
for i in range(len(s)):
    if i%2 == 0:
        if s[i] not in a:
            iscan = False
    else:
        if s[i] not in b:
            iscan = False
print("Yes" if iscan else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

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

    
    
main()

Submission status: Accepted

Solution code:
S = input()
L = len(S)
odd = "RUD"
even = "LUD"
for i in range(L):
  if (i+1)%2 != 0:
    if S[i] not in odd:
      print("No")
      exit()
  else:
    if S[i] not in even:
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
is_odd = True
for i in input():
    if is_odd and i in ("R","U","D"):
        is_odd = not is_odd
    elif not is_odd and i in ("L","U","D"):
        is_odd = not is_odd
    else:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

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

#print(s)
s.insert(0,"0")
for i in range(len(s)):
  #print(s[i])
  if(i%2 == 0):
    if(s[i] not in even):
      print("No")
      exit()
  else:
    if(s[i] not in odd):
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
n=input()
l=len(n)
h="Yes"
for i in range(0,len(n)):
    if (i+1)%2!=0:
        if n[i]=="R"or n[i]=="U"or n[i]=="D" :
            pass
        else:
            h="No"
            break
    else:
        if n[i]=="L"or n[i]=="U"or n[i]=="D" :
            pass
        else:
            h="No"
            break
print(h)

Submission status: Accepted

Solution code:
S = input()
even = [v for i, v in enumerate(S) if i % 2 == 0]
odd = [v for i, v in enumerate(S) if i % 2 == 1]
count = even.count("L") + odd.count("R")
print("Yes" if count == 0 else "No")

Submission status: Accepted

Solution code:
S = input()

odd_cond = True
even_cond = True

for i,s in enumerate(S):
    if (i+1)%2 == 1:
        if s not in ["R", "U", "D"]:
            odd_cond = False
            break
    else:
        if s not in ["L", "U", "D"]:
            even_cond = False
            break
        
            
if odd_cond and even_cond:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

a = set(['R','U','D'])
b = set(['L','U','D'])

ck = False
for i,data in enumerate(s):
  if (i+1) % 2 :
    if not data in a:
      break
  else :
    if not data in b:
      break
else:
  ck = True

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
a = s[::2].count('L') + s[1::2].count('R')
if a > 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()


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

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

Submission status: Accepted

Solution code:
S = input()
# L = len(S) % 2
youtube = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    s = list(input()[:-1].decode())
    for i in range(len(s)):
        if i % 2 == 0:
            if not s[i] in ['R', 'U', 'D']:
                print('No')
                exit()
        else:
            if not s[i] in ['L', 'U', 'D']:
                print('No')
                exit()
    print('Yes')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
def f(s):
	p = True
	for u in s:
		if u == ('L' if p else 'R'): return False
		p ^= True 
	return True
print 'Yes' if f(raw_input()) else 'No'

Submission status: Accepted

Solution code:
def f(s):
	p = True
	for u in s:
		if u not in ('RUD' if p else 'LUD'): return False
		p ^= True 
	return True
print 'Yes' if f(raw_input()) else 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

mem = True
for i, s in enumerate(S):
    if (i+1)%2 == 1:
        if not s in ['R', 'U', 'D']:
            mem *= False
    else:
        if not s in ['L', 'U', 'D']:
            mem *= False
if mem:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

s = input()
s_len = len(s)

odd = s[::2] #スライスを利用してsの奇数番目を取り出す
even = s[1::2]

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

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=str(input())
s=list(s)
counta=0
countb=0
for i in range(len(s)):
  if(i%2==0):
    if(s[i]=="R" or s[i]=="U" or s[i]=="D"):
      counta+=1
  elif(i%2==1):
    if(s[i]=="L" or s[i]=="U" or s[i]=="D"):
      countb+=1
if(counta+countb==len(s)):
  print("Yes")
  
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tap=input()
f=0
for i,s in enumerate(tap):
  if i % 2 == 0:
    if s not in 'RUD':
      f = 1
      break
  else:
    if s not in 'LUD':
      f = 1
      break
print('YNeos'[f::2])

Submission status: Accepted

Solution code:
s = input()

l_odd = ['R', 'U', 'D']
l_even = ['L', 'U', 'D'] 

for i, ch in enumerate(s):
    if (i+1)%2 != 0 and ch not in l_odd:
        print('No')
        break
    if (i+1)%2 == 0 and ch not in l_even:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()
flag = True

for x in range(len(S)):
    if x % 2 == 0:
        if S[x] != "R" and S[x] != "U" and S[x] != "D":
            flag = False
            break
    else:
        if S[x] != "L" and S[x] != "U" and S[x] != "D":
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

s = input()

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

print("Yes")

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

odd = 'RUD'
even = 'LUD'

S = rs()

for i, c in enumerate(S):
	if i % 2 == 0:
		if c not in odd:
			print('No')
			exit()
	else:
		if c not in even:
			print('No')
			exit()
print('Yes')

Submission status: Accepted

Solution code:
def examA():
    W = {'Sunny':'Cloudy','Cloudy':'Rainy','Rainy':'Sunny'}
    S = SI()
    ans = W[S]
    print(ans)
    return

def examB():
    R = {"R","U","D"}
    L = {"L","U","D"}
    S = SI()
    ans = "Yes"
    for i,s in enumerate(S):
        if i%2==0 and s in R:
            continue
        if i%2==1 and s in L:
            continue
        ans = "No"
        break
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    # https://tjkendev.github.io/procon-library/python/string/z-algorithm.html
    def z_algo(S):
        N = len(S)
        A = [0] * N
        i = 1; j = 0
        A[0] = l = len(S)
        while i < l:
            while i + j < l and S[j] == S[i + j]:
                j += 1
            if not j:
                i += 1
                continue
            A[i] = j
            k = 1
            while l - i > k < j - A[k]:
                A[i + k] = A[k]
                k += 1
            i += k; j -= k
        return A
    N = I()
    S = SI()
    ans = 0
    for i in range(N):
        Z = z_algo(S[i:])
        for k,n in enumerate(Z[1:]):
            cur = min(k+1,n)
            ans = max(ans,cur)
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""

Submission status: Accepted

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    S = list(readline().rstrip().decode())
    for s in S[::2]:
        if s == 'L':
            print('No')
            return
    for s in S[1::2]:
        if s == 'R':
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s= str(input())

for i in range(len(s)):
    if (i+1)%2==1:
        if s[i] not in "RUD":
            print('No')
            exit(0)
        else:
            pass
    else:
        if s[i] not in "LUD":
            print('No')
            exit(0)
        else:
            pass
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
k = ['R', 'U', 'D']
g = ['L', 'U', 'D']
k_count = 0
g_count = 0
kisuu = 0
guusuu = 0
for i in range(0, len(s)):
  if i%2 != 0:
    guusuu += 1
    if (s[i] in g) == True:
      g_count += 1
  if i%2 == 0:
    kisuu += 1
    if (s[i] in k) == True:
      k_count += 1
if kisuu == k_count and guusuu == g_count:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    # 奇数文字目
    if i % 2 ==0:
        if s[i] == 'L':
            print('No')
            exit()
    # 偶数文字目
    else:
        if s[i] == 'R':
            print('No')
            exit()
            
print('Yes')

Submission status: Accepted

Solution code:
S = input()
flg = True

for i, c in enumerate(S):
    if (i%2==0 and c=='L') or (i%2==1 and c=='R'):
        flg = False

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

Submission status: Accepted

Solution code:
s = list(input())
ans = "Yes"
for i in range(len(s)):
    if i%2 == 0: #奇数文字目
        if s[i] == 'L':
            ans = "No"
    else:
        if s[i] == 'R':
            ans = "No"

print (ans)

Submission status: Accepted

Solution code:
s = input()
ls = len(s)
isOk = True
for i in range(ls):
    if(i%2==1 and s[i]=='R'):
        isOk = False
    if(i%2==0 and s[i]=='L'):
        isOk = False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

R = {'R', 'U', 'D'}
L = {'L', 'U', 'D'}


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

Submission status: Accepted

Solution code:
def tap_dance(s):

    ki = s[0::2]
    gu = s[1::2]
    ans = "Yes"

    if "L" in ki:
        ans = "No"
    if "R" in gu:
        ans = "No"

    return ans

def main():
    s = str(input())
    print(tap_dance(s))

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

Submission status: Accepted

Solution code:
s = input()
t = list(filter(lambda x: x in ['R','U','D'],s[0::2]))
u = list(filter(lambda x: x in ['L','U','D'],s[1::2]))
print('Yes' if len(s[0::2]) == len(t) and len(s[1::2]) == len(u) else 'No')

Submission status: Accepted

Solution code:
s=input()
c=0
for i in range(len(s)):
    if i%2==0:
        if s[i] not in "RUD":
            c+=1
            break
    else:
        if s[i] not in "LUD":
            c+=1
            break
print("Yes"if c==0 else"No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
    if i%2==0:
        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:
ss = input()
count = 0
ans  = 0
for s in ss:
    if count%2 == 0 and s != "L":
        pass
    elif count%2 == 0:
        ans += 1
    elif count%2 == 1 and s != "R":
        pass
    elif count%2 == 1:
        ans += 1
    count += 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")
      exit()
  else:
    if S[i] == "R":
      print("No")
      exit()
      
print("Yes")

Submission status: Accepted

Solution code:
S = input()
FLG = True

for i,step in enumerate(S):
    if step in "UD":
        continue
    if step == "L" and i % 2 == 0:
        FLG = False
        break
    if step == "R" and i % 2 == 1:
        FLG = False
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
frag = True
c = 0
for i in S:
    if c%2==0:
        if i=='L':
            frag = False
    if c%2==1:
        if i=='R':
            frag = False
    c+=1
if frag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
"""
abc141-b
"""

S = input()

ans="Yes"

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

Submission status: Accepted

Solution code:
ss=input().strip()
ki=["R","U","D"]
gu=["L","U","D"]

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

Submission status: Accepted

Solution code:
Ss = input().rstrip()

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
OK=[0]*N
for i in range(N):
    if (i+1)%2==0:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            OK[i]=1
        else :
            OK[i]=0
    else :
        if S[i]=="R" or S[i]=="U" or S[i]=="D":
            OK[i]=1
        else :
            OK[i]=0
print("Yes" if sum(OK)==N else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
L = len(S)
for i in range(1,L,2):
    if S[i] == 'L' or S[i]=='U' or S[i]=='D':
        pass
    else:
        print('No')
        exit()

for j in range(0,L,2):
    if S[j]=='R' or S[j]=='U' or S[j]=='D':
        pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
S = list(input())
result = True
for i in range(len(S)):
  if (i+1) % 2 == 0:
    if S[i] == 'R':
      result = False
      break
  elif (i+1) % 2 != 0:
    if S[i] == 'L':
      result = False
      break
print('Yes' if result else 'No')

Submission status: Accepted

Solution code:
from sys import exit

s = input()

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

Submission status: Accepted

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

s = list(str(input()))


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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input().rstrip()

r = 'Yes'
for i in range(len(s)):
	if (i + 1) % 2 == 0:
		if s[i] in 'LUD':
			pass
		else:
			r = 'No'
	else:
		if s[i] in 'RUD':
			pass
		else:
			r = 'No'

	if r != 'Yes':
		break

print(r)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
 
for i in range((len(S)+1)//2):
  if S[2*i] == 'R' or S[2*i] == 'U' or S[2*i] == 'D':
    pass
  else:
    print('No')
    exit()

for j in range(len(S)//2):
  if S[2*j+1] == 'L' or S[2*j+1] == 'U' or S[2*j+1] == 'D':
    pass
  else:
    print('No')
    exit()

print('Yes')

Submission status: Accepted

Solution code:
s=list(input())
"""
    奇数文字目がすべて R, U, D のいずれか。
    偶数文字目がすべて L, U, D のいずれか。
"""
for ii in range(len(s)):
  if ii%2==0 and s[ii]=="L":
    print("No")
    exit()
  if ii%2==1 and s[ii]=="R":
    print("No")
    exit()    
print("Yes")

Submission status: Accepted

Solution code:
s = input()
c = 0
for i in range(len(s)):
  if i%2==0 and s[i] != 'L':
    continue
  elif i%2==1 and s[i] != 'R':
    continue
  else:
    c = 1
print('Yes' if c==0 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()
    if i%2==1:
        if S[i] =='R':
            print('No')
            exit()
print('Yes')

Submission status: Accepted

Solution code:
# =map(int,input().split())
S=input()
count=0
for i in range(len(S)):
    if i % 2== 0:#奇数の時
        if S[i]=="R" or S[i]=="U" or S[i]=="D":
            count+=0
        else:
            count+=1
    else:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            count+=0
        else:
            count+=1
           
if count==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())
flag = 0

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

Submission status: Accepted

Solution code:
# input
S = input()

# check
fl = True
for i, s in enumerate(S):
    if (
            ((i + 1) % 2 == 0 and s not in ["L", "U", "D"]) or
            ((i + 1) % 2 == 1 and s not in ["R", "U", "D"])
    ):
        fl = False
        break
        
if fl is True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 23:42:46 2020

@author: Kanaru Sato
"""

s = list(input())
Noflag = 0

for i in range(0,len(s)):
    if i%2 == 0:
        if s[i] != "R" and s[i] != "U" and s[i] != "D":
            Noflag = 1
            break
    if i%2 != 0:
        if s[i] != "L" and s[i] != "U" and s[i] != "D":
            Noflag = 1
            break

if Noflag == 1:
    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":
    continue
  elif i % 2 != 0 and s[i] != "R":
    continue
  else:
    print("No")
    break
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

print('Yes')

Submission status: Accepted

Solution code:
S=input()

i=0
while i<len(S):
    if (i+1)%2==0:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            pass
        else:
            print("No")
            quit()
    else:
        if S[i]=="R" or S[i]=="U" or S[i]=="D":
            pass
        else:
            print("No")
            quit()
    i+=1
    
print("Yes")

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
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")
            quit()
    else:
        if not(s[i] == "L" or s[i] == "U" or s[i]=="D"):
            print("No")
            quit()
print("Yes")

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%2==0:
        if s[i] in odd:
            cnt+=1
    else:
        if s[i] in even:
            cnt+=1
if cnt==len(s):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
easy = True
sr = S[::2]
sl = S[1::2]
if 'L' in sr: easy = False
if 'R' in sl: easy = False
if easy:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

s = input()

for i in range(len(s)):
    if s[i] == "U" or s[i] == "D":
        continue
    elif (i+1) % 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 math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]=='L'):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
a = ['R', 'U', 'D']
b = ['L', 'U', 'D']

def judge():
    for i in range(len(s)):
        if i%2==0 and s[i] not in a:
            return False
        if i%2==1 and s[i] not in b:
            return False
    return True

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