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 i in range(len(S)+1):
  if i == len(S):
    print('Yes')
    break
  if S[i] =='U' or S[i] =='D':
    pass
  else:
    if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break

Submission status: Accepted

Solution code:
a=input()
b=0
if (len(a))%2==0:
  for i in range(int(len(a)/2)):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b==len(a):
    print("Yes")
  else:
    print("No")
if (len(a))%2==1:
  for i in range(int(len(a)/2)+1):
    if a[2*i]=="R" or a[2*i]=="U" or a[2*i]=="D":
      b=b+1
  for i in range(int(len(a)/2)):
    if a[2*i+1]=="L" or a[2*i+1]=="U" or a[2*i+1]=="D":
      b=b+1
  if b==len(a):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


def main():
    S = input()

    def judge():
        for i in range(len(S)):
            if i % 2 == 0:
                if S[i] == "L":
                    return False
            else:
                if S[i] == "R":
                    return False
        return True

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
x=['R','U','D']
y=['L','U','D']
l=len(S)
for i in range(l):
  if (i+1)%2!=0:
    if S[i]not in x:
      print('No')
      exit()
  else:
    if S[i] not in y:
      print('No')
      exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = "Yes"

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

print(ans)

Submission status: Accepted

Solution code:
S =str(input())
S.split()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']
c = 0

for i in range(len(S)):
  if i%2 == 0:
    if S[i] in kisu:
      c += 1
  else:
    if S[i] in gusu:
      c += 1
      

if c == len(S):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
for i in range(len(S)):
    if i % 2 == 0 and S[i] == "R" or S[i] == "U" or S[i] == "D":
        cnt += 1
    elif i % 2 == 1 and S[i] == "L" or S[i] == "U" or S[i] == "D":
        cnt += 1

if cnt == len(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    s = input()
    flag = True

    for i in range(len(s)):
        if i % 2 == 0:  # 奇数文字目
            if s[i] not in ["R", "U", "D"]:
                flag = False
                break
        else:  # 偶数文字目
            if s[i] not in ["L", "U", "D"]:
                flag = False
                break

    if flag:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)


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"
    elif i%2 == 1 and S[i] == "R":
        ans = "No"
print(ans)

Submission status: Accepted

Solution code:
# 問題：https://atcoder.jp/contests/abc141/tasks/abc141_b

s = input()
i = 1
res = True
for ch in s:
    if i % 2 == 1 and ch == 'L':
        res = False
        break
    elif i % 2 == 0 and ch == 'R':
        res = False
        break
    i += 1

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

Submission status: Accepted

Solution code:
s = list(input())

for i in s[::2]:
    if i=='L':
        print('No')
        exit()

for i in s[1::2]:
    if i=='R':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

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

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"

#奇数
os=s[::2]
#print(os)
if "L" in os:
    ans="No"


#偶数
es=s[1::2]
#print(es)
if "R" in es:
    ans="No"
    
print(ans)

Submission status: Accepted

Solution code:
s = input()
a = 1
f = 0
for i in s:
  if a == 1 and i == "L":
    print("No")
    f = 1
    break
  if a == 0 and i == "R":
    print("No")
    f = 1
    break
  a ^= 1
if f == 0:
  print("Yes")

Submission status: Accepted

Solution code:
def main():
    s = input()
    odds = ("R", "U", "D")
    even = ("L", "U", "D")
    ans = True
    for index, i in enumerate(s, 1):
        if index % 2 == 0 and not i in even:
            ans = False
        if index % 2 != 0 and not i in odds:
            ans = False

    print("Yes" if ans == True else "No")


main()

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:
# coding: utf-8

str = input()
table = list(str)
count = 0
for i in range(len(table)):
    if i % 2 == 0:
      if table[i] == 'R' or table[i] == 'U' or table[i] == 'D':
         count += 1
    elif i % 2 == 1:
      if table[i] == 'L' or table[i] == 'U' or table[i] == 'D':
         count += 1

if count == len(str):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


s = input()
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
else:
    ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

ans='No'

for i,ss in enumerate(s):
  if i%2==0:
    if ss =='R' or ss=='U' or ss=='D':
      ans ='Yes'
    else:
      ans='No'
      break
  else:
    if ss=='L' or ss=='U' or ss=='D':
      ans='Yes'
    else:
      ans='No'
      break
print(ans)

Submission status: Accepted

Solution code:
# B Tap Dance
s = input()
S = len(s)
for i in range(S):
    if i % 2:  # 奇数
        if s[i] == "R":
            print("No")
            exit()
    else:
        if s[i]  == "L":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

cnt=0

for i in range(0,len(s),2):
  if s[i]=='L':
    cnt+=1

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

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

Submission status: Accepted

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

s = input()
frag = True

for i, c in enumerate(s):
  if i%2 ==0:
    if c not in odd:
      frag = False
      break
  else:
    if c not in even:
      frag = False
      break

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

Submission status: Accepted

Solution code:
def f():
    s = input()
    for i in range(len(s)):
        if i%2 == 1:
            if s[i] == "L" or s[i] == "U" or s[i] == "D":
                continue
            else:
                return "No"
        else:
            if s[i] == "R" or s[i] == "U" or s[i] == "D":
                continue
            else:
                return "No"
    return "Yes"
print(f())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()
k = ['R','U', 'D']
g = ['L', 'U', 'D']
isOK = True
i = 1
for t in s:
    if(i%2 == 0):
        isOK = t in g
    else:
        isOK = t in k
    if(isOK == False):
        break
    i += 1
print('Yes' if isOK else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
i=0
flag=0
while i<len(s):
    if (i+1)%2==0:
        if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
         
    else:
        if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
     

    if flag==1:
        break


    i+=1

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = list(input())
odd = set(['R', 'U', 'D'])
even = set(['L', 'U', 'D'])

leng = len(S)
for i in range(leng):
    if i%2==1:
        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:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
o = ["R", "U", "D"]
e = ["L", "U", "D"]
x = 1
for i in range(l):
    if i == (2 * int(i / 2)):
        if s[i] not in o:
            x = 0
    else:
        if s[i] not in e:
            x = 0
print("Yes" if x == 1 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Written by Shagoto
s = input()
i = 0
check = True
while(i < len(s)):
    if(i % 2 == 0 and s[i] == "L"):
        check = False
        break
    elif(i % 2 == 1 and s[i] == "R"):
        check = False
        break
    i += 1

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

Submission status: Accepted

Solution code:
S = list(input())

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

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 S[0::2].count('L') == 0 and S[1::2].count('R') == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

for s in S[0::2]:
  if s not in "RUD":
    print("No")
    exit()

for t in S[1::2]:
  if t not in "LUD":
    print("No")
    exit()
    
print("Yes")

Submission status: Accepted

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

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
sys.setrecursionlimit(10 ** 7)

S = input()

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

for i, s in enumerate(S):
    if not i % 2 and s not in odd:
        print('No')
        sys.exit()
    if i % 2 and s not in even:
        print('No')
        sys.exit()

print('Yes')

Submission status: Accepted

Solution code:
s = input()
tapflag = True

for p in range(len(s)):
  if p % 2 == 0:
    if s[p] != 'R' and s[p] != 'U' and s[p] != 'D':
      tapflag = False
  if p % 2 == 1:
    if s[p] != 'L' and s[p] != 'U' and s[p] != 'D':
      tapflag = False
      
if tapflag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 'Yes'
for index, value in enumerate(s):
    if (index + 1)%2 == 0 and value not in ['L', 'U', 'D']:
        ans = 'No'
    elif (index + 1)%2 != 0 and value not in ['R', 'U', 'D']:
        ans = 'No'
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
ans="Yes"
for i in range(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:
s = str(input())
isError = False
for i in range(len(s)):
    if i%2==0:
        if s[i]=='L':
            isError = True
    else:
        if s[i]=='R':
            isError = True
if isError:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(LS):
  if i%2 == 1:
    if S[i] == "R":
      print("No")
      exit()
  else:
    if S[i] == "L":
      print("No")
      exit()
      
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

flag = True

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

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
###############################################################################\
s=input()
bool=True
for i in range(len(s)):
    if i%2==0:
        if s[i]=="R" or s[i]=="U" or s[i]=="D":
            continue
        else:
            bool=False
            break
    else:
        if s[i]=="L" or s[i]=="U" or s[i]=="D":
            continue
        else:
            bool=False
            break

if bool is True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(input())
f = False

for i in range(len(l)):
    if i % 2:
        if l[i] == 'L' or l[i] == 'U' or l[i] == 'D':
            f = True
        else:
            f = False
            break
    else:
        if l[i] == 'R' or l[i] == 'U' or l[i] == 'D':
            f = True
        else:
            f = False
            break

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

Submission status: Accepted

Solution code:
S = input()

print('No' if('L' in set(S[::2]) or 'R' in set(S[1::2])) else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

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

s = list(input())

for i, posi in enumerate(s):
    num = i+1
    if num % 2 == 0 and posi == 'R':
        print('No')
        exit(0)
    elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0)

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ki = 'RUD'
gu = 'LUD'
for i, s in enumerate(S):
    if i%2 == 0:
        if s not in ki:
            print('No')
            exit()
    else:
        if s not in gu:
            print('No')
            exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

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:
S = input()
count = 0
for i in range(len(S)):
  if i%2 == 0:
    if 'RUD'.count(S[i]) != 1:
      count +=1
  else:
    if 'LUD'.count(S[i]) != 1:
      count +=1
if count == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print('Yes')

Submission status: Accepted

Solution code:
s=str(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()
if ("L" in S[::2]) or ("R" in S[1::2]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
if len(set(S[::2]) - {"R","U","D"}) == 0 and len(set(S[1::2]) - {"L","U","D"}) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
cnt = 0
for s in S[::2]:
    if s in {"R", "U", "D"}:
        cnt += 1
for s in S[1::2]:
    if s in {"L", "U", "D"}:
        cnt += 1
if cnt == len(S):
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
s=input()
t=0
if any([i=="R" for i in s[1::2]]) or any([i=="L" for i in s[::2]]):
    t=1
print("YNeos"[t::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
S = list(input())
S_odd = [s for i, s in enumerate(S) if i % 2 == 0]
S_even = [s for i, s in enumerate(S) if i % 2 != 0]
if 'L' in S_odd or 'R' in S_even:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
import sys
n = len(s)
kisuu = ["R","U","D"]
guusuu = ["L","U","D"]

for i in range(n):
    if i%2 == 0:
        if s[i] not in kisuu:
            break
    else:
        if s[i] not in guusuu:
            break
else:
    print("Yes")
    sys.exit()
print("No")

Submission status: Accepted

Solution code:
s=input()
count=1
ans='Yes'
for i in s:
    if count%2==1:
        if i=='R' or i=='U' or i=='D':
            count+=1
            continue
        else:
            ans='No'
            break
    else:
        if i=='L' or i=='U' or i=='D':
            count+=1
            continue
        else:
            ans='No'
            break
print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()

l1 = ['L', 'U', 'D']
l2 = ['R', 'U', 'D']

cnt = 0
for i in range(len(s)):
  if i == 0 or i%2 == 0:
    if s[i] not in l2:
      print('No')
      sys.exit()
  else:
    if s[i] not in l1:
      print('No')
      sys.exit()

print('Yes')

Submission status: Accepted

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