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

Solution (Python):
S = input()

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

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

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

ans = "Yes"

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

print(ans)

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

Solution (Python):
import re

S = input()

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

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

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



if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

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

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

Solution (Python):

import sys

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


if __name__ == "__main__":
    solve()

Solution (Python):

s = input()



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

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

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

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

S = input()

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

main()

Solution (Python):
s = str(input())

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

print('Yes')

Solution (Python):
S = input()
f1 = all(s in 'RUD' for s in S[::2])
f2 = all(s in 'LUD' for s in S[1::2])
print('Yes' if f1 and f2 else 'No')

Solution (Python):
S = input()

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

flg = False

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

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

Solution (Python):
s = input()

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

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

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

Solution (Python):

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

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

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

Solution (Python):
import sys

input = sys.stdin.readline

S = input().strip()

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

print(ans)

Solution (Python):
s = input();

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


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

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

Solution (Python):
import sys
from pprint import pprint

def solve(s):
    odd = ['R', 'U', 'D']
    even = ['L', 'U', 'D']
    for i, s_i in enumerate(s):
        if i % 2 == 0:
            if s_i not in odd:
                print("No")
                return
        if i % 2 == 1:
            if s_i not in even:
                print("No")
                return

    print("Yes")

if __name__ == '__main__':
  s = sys.stdin.readline().strip()
  solve(s)

Solution (Python):
S = input()

i = 1
flg = 0

for s in S:
  if i % 2 == 1:
    if s != 'R' and s != 'U' and s != 'D':
      flg = 1
      print('No')
      break
      
  if i % 2 == 0:
    if s != 'L' and s != 'U' and s != 'D':
      flg = 1
      print('No')
      break  
      
  i = i + 1
      
if flg == 0:
  print('Yes')

Solution (Python):
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()
    i += 1
print("Yes")

Solution (Python):
S = list(input())

hantei = 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:
            hantei = False
            break
    else:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
             continue
        else:
            hantei = False
            break
if hantei:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
sys.setrecursionlimit(100000)

def ins(): return input().split()
def ii(): return int(input())
def iil(): return list(map(int,ins()))
def lin(): return list(input())
def iin(): return map(int,ins())

s = input()
for i,j in enumerate(s):
    if j == 'U' or j == 'D':
        continue
    elif (j == 'R' and i%2==1) or (j == 'L' and i%2==0):
        print('No')
        break
else:
    print('Yes')

Solution (Python):
S=list(input())
flag=0
for i in range(len(S)):
    if i%2==0:
        if S[i]=="L":
            flag=1
            break
    elif i%2==1:
        if S[i]=="R":
            flag=1
            break

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

Solution (Python):






S = input()





odd_list = list(S[::2])
even_list = list(S[1::2])





if "L" in odd_list:
    print("No")
elif "R" in even_list:
    print("No")
else:
    print("Yes")

Solution (Python):
S=list(input())
X=""
for i in range(len(S)):
    if i%2==0:
        if S[i]=="L":
            X="No"
        else:
            continue
    else:
        if S[i]=="R":
            X="No"
        else:
            continue

if X=="No"   :
    print("No")

else:
    print("Yes")

Solution (Python):
def main():
    s = input()

    ans = 'Yes'

    for odd_s in s[::2]:
        if odd_s not in ['R', 'U', 'D']:
            ans = 'No'
            return(ans)

    for even_s in s[1:][::2]:
        if even_s not in ['L', 'U', 'D']:
            ans = 'No'
            return(ans)

    return(ans)

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
S = input()

for i, v in enumerate(S):
    if i % 2 == 0 and v in ["R", "U", "D"] or i % 2 == 1 and v in ["L", "U", "D"]:
        pass
    else:
        print("No")
        exit()
print("Yes")

Solution (Python):
step = input()
flag = True
for i, n in enumerate(step):
  if i%2==0:
    if n is "L":
      print("No")
      flag = False
      break      
  if i%2 == 1:
    if n is "R":
      print("No")
      flag = False
      break
if flag:
  print("Yes")

Solution (Python):
s = input()
c = 0

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

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

Solution (Python):
s = input()
is_good = True
for i, c in enumerate(s):
    if (i + 1) % 2 == 1:
        if c == 'L':
            is_good = False
            break
    else:
        if c == 'R':
            is_good = False
            break
print('Yes' if is_good else 'No')

Solution (Python):
s = input()
L = len(s)



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

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

Solution (Python):

S = list(str(input()))

count=0
for i, s in enumerate(S):
    if i%2==0:
        if s!="U" and s!="D" and s!="R":
             count=1
             break

    else:
        if s!="U" and s!="D" and s!="L":
             count=1
             break

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

Solution (Python):
S = list(input().strip())

odd_cond = ("R", "U", "D")
even_cond = ("L", "U", "D")


for i, s in enumerate(S):
    if i % 2 == 0:
        cond = s in odd_cond
    else:
        cond = s in even_cond

    if not cond:
        print("No")
        break

if cond:
    print("Yes")

Solution (Python):
s = input()
n = len(s)
odd = {'R','U','D'}
even = {'L','U','D'}

cnt = 0

for i in range(n):
  if i % 2 == 0 and s[i] in odd:
    cnt += 1
  elif i % 2 == 1 and s[i] in even:
    cnt += 1
    
print('Yes' if cnt == n else 'No')

Solution (Python):
s = input()
s_ki = s[0::2]
s_gu = s[1::2]
count = 0
for i in s_ki:
    if i == 'L':
        count += 1
for _ in s_gu:
    if _ == 'R':
        count += 1
if count ==0:
    print('Yes')
else:
    print('No')

Solution (Python):
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+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())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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

Solution (Python):
def resolve():
    S = input()

    ans = "Yes"
    n = len(S)
    for i in range(n):
        if i % 2 != 0: 
            if S[i] == "R":
                ans = "No"
        if i % 2 == 0: 
            if S[i] == "L":
                ans = "No"
    print(ans)
resolve()

Solution (Python):
for i,v in enumerate(input()):
	if (i+1)%2==0:
		if v=='R':
			print('No')
			exit()
	else:
		if v=='L':
			print('No')
			exit()
else:
	print('Yes')

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

Solution (Python):
s = input()

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

Solution (Python):
odds = ['R','U','D']
evens = ['L','U','D']
steps = list(input())
if len(set(steps[0::2])-set(odds)) == 0 and len(set(steps[1::2])-set(evens)) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):



S = input()


ans = True
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 'L':
            ans = False
            break
    else:
        if S[i] == 'R':
            ans = False
            break


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

Solution (Python):
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')

Solution (Python):
s = input()

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

Solution (Python):
S = input()
Se = list(filter(lambda s:s=='L',S[::2]))
So = list(filter(lambda s:s=='R',S[1::2]))
re = 'Yes' if len(Se)+len(So) == 0 else 'No'
print(re)

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

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

Solution (Python):
S = list(input())
is_ok = False
for n, s in enumerate(S):
    if n % 2 == 0:
        if s == "R" or s == "U" or s == "D":
            is_ok = True
        else:
            is_ok = False
            break
    if n % 2 == 1:
        if s == "L" or s == "U" or s == "D":
            is_ok = True
        else:
            is_ok = False
            break
if is_ok:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

count = 0
for s in range(len(S)):
    if (s+1) % 2 == 1 and (S[s] == 'R' or S[s] == 'U' or S[s] == 'D'):
        count += 1

    elif (s+1) % 2 == 0 and (S[s] == 'L' or S[s] == 'U' or S[s] == 'D'):
        count += 1

if count == len(S):
    print('Yes')

else:
    print('No')

Solution (Python):
import sys
S=input()
for s in S[0::2]:
    if s == "L":
        print("No")
        sys.exit()
for s in S[1::2]:
    if s == "R":
        print("No")
        sys.exit()
print("Yes")

Solution (Python):
S = input()

ans = 'Yes'
even = ['L', 'U', 'D']
odd = ['R', 'U', 'D']
for i in range(len(S)):
    if i%2 ==1 and S[i] not in even:
        ans = 'No'
        break
    if i%2 ==0 and S[i] not in odd: 
        ans = 'No'
        break

print (ans)

Solution (Python):
import sys

seq = sys.stdin.readline().strip()
odd_str = 'RUD'
even_str = 'LUD'
result = 'Yes'

for i in range(len(seq)):
    c = seq[i]
    if (i + 1) % 2 == 0:
        if not c in even_str:
            result = 'No'
    else:
        if not c in odd_str:
            result = 'No'

print(result)

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

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

for i in range(0, N, 2):
    if S[i] in odd:
        continue
    else:
        print('No')
        exit()

for i in range(1, N, 2):
    if S[i] in even:
        continue
    else:
        print('No')
        exit()

print('Yes')

Solution (Python):
steps = list(input())
def test(ss):
    odd = set("RUD")
    even = set("LUD")
    for i, s in enumerate(ss):
        num = i+1
        if num%2:
            if s not in odd:
                return "No"
        elif s not in even:
            return "No"
    return "Yes"
print(test(steps))

Solution (Python):


import sys

input = sys.stdin.readline
s = input()
odd = "R"
even = "L"
ans = 0

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

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

Solution (Python):
def main():
    s = input()

    for i in range(len(s)):
        if (i+1)&1 == 1:
            if (s[i] == "R") + (s[i] == "U") + (s[i] == "D"):
                pass
            else:
                print("No")
                return
        elif (i+1)&1 == 0:
            if (s[i] == "L") + (s[i] == "U") + (s[i] == "D"):
                pass
            else:
                print("No")
                return

    print("Yes")

main()

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

Solution (Python):
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")

Solution (Python):







S = input()





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

Solution (Python):
S = list(input())
bool = "true"

for i in range(0, len(S), 2):
    if S[i] == "L":
        bool = "false"

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

if bool == "true":
    print("Yes")

else:
    print("No")

Solution (Python):
S = input()
odd ={"R","U","D"}
even = {"L","U","D"}
l = len(S)
S_odd = {S[i] for i in range(l) if i%2==0}
S_even = {S[i] for i in range(l) if i%2==1}

if S_odd <= odd and S_even <= even:
    print("Yes")
else:
    print("No")

Solution (Python):
str = input()

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

Solution (Python):
import sys
S = input()
for i,item in enumerate(S):
    if i%2==0:
        if item not in ['R', 'U', 'D']:
            print('No')
            sys.exit()
    else:
        if item not in ['L', 'U', 'D']:
            print('No')
            sys.exit()
print('Yes')

Solution (Python):
S = input()
count = 0
kisu = ["R", "U", "D"]
dusu = ["L", "U", "D"]
H = 0

for c in S:
    count += 1
    if count % 2 == 1:
        if c in kisu:
            pass
        else:
            H = 1
    else:
        if c in dusu:
            pass
        else:
            H = 1

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

Solution (Python):
def A():
    w = ['Sunny', 'Cloudy', 'Rainy']
    today = input()
    index = w.index(today)
    if index == 2:
        index = -1
    print(w[index+1])

def B():
    odd = 'RUD'
    even = 'LUD'

    s = input()
    for i in range(len(s)):
        if (i+1)%2 == 0:
            if s[i] not in even:
                print('No')
                return
        else:
            if s[i] not in odd:
                print('No')
                return
        
    print('Yes')

B()

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

n=1
yes=True
for i in s:
	if n%2!=0:
		if (i=="R" or i=="U" or i=="D"):
			pass

		else:
			yes=False

	else:
		if  (i=="L" or i=="U" or i=="D"):

			pass
		else:
			yes=False
	n+=1

if yes:
	print("Yes")

else:
	print("No")

Solution (Python):
S = input()
result = 'Yes'

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

print(result)

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

Solution (Python):
S = input()

kisuu_list = ['R', 'U', 'D']
gusuu_list = ['L', 'U', 'D']

flag = "Yes"
for i in range(len(S)):
  if i%2 == 0 and S[i] not in kisuu_list:
    flag = "No"
    break
  if i%2 == 1 and S[i] not in gusuu_list:
    flag = "No"
    break
print(flag)

Solution (Python):
s = input()

f = True
for i in range(0, len(s), 2):
  if not (s[i] == 'R' or s[i] == 'U' or s[i] == 'D'):
    f = False
for i in range(1, len(s), 2):
  if not (s[i] == 'L' or s[i] == 'U' or s[i] == 'D'):
    f = False
print('Yes' if f else 'No')

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

S=input()
S_num=len(S)

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

Solution (Python):
N = input()

answer = 'Yes'
for i in range(1, len(N)+1):

    
    if i % 2 == 0:
        if N[i-1] == 'R':
            answer = 'No'
            break
    else:
        if N[i-1] == 'L':
            answer = 'No'
            break

print(answer)

Solution (Python):
s = input()
isOdd = True
for i in range(len(s)):
    if isOdd == False and s[i] == 'R':
        print('No')
        exit()
    if isOdd == True and s[i] == 'L':
        print('No')
        exit()
    isOdd = not isOdd

print('Yes')

Solution (Python):
S = list(input())
od = ['R', 'U', 'D'] 
ev = ['L', 'U', 'D'] 

ans = 'Yes'
for i,s in enumerate(S):
    if i%2 == 0:
        if s in od:
            pass
        else:
            ans = 'No'
            break
    else:
        if s in ev:
            pass
        else:
            ans = 'No'
            break

print(ans)

Solution (Python):
STR = [s for s in input()] 
k = 0
for i in range((len(STR)+1)//2  ):
    if STR[i*2] == "L":
        k = 1
    else:
        pass 
for i in range((len(STR))//2  ):
    if STR[i*2+1] == "R":
        k = 1
    else:
        pass 

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

Solution (Python):
n = (input())

f = 0

for i in range(len(n)):
  if n[i] != 'U' and  n[i] != 'D':
    if i % 2 == 0:
      if n[i] != 'R':
        f = 1
    else:
      if n[i] != 'L':
        f = 1

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

Solution (Python):
tap = input()

tap_odd = tap[::2]
tap_even = tap[1::2]

if 'L' in tap_odd or 'R' in tap_even:
    print('No')
else:
    print('Yes')

Solution (Python):

from copy import deepcopy


def main():
    s = input()

    s_list = list(s)
    one_result = True
    two_result = True
    for i in range(len(s_list)):
        if i % 2 == 0:
            if s_list[i] == 'L':
                one_result = False
        else:
            if s_list[i] == 'R':
                two_result = False

    if one_result and two_result:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
if set(s[0::2]) <= {"R", "U", "D"} and set(s[1::2]) <= {"L", "U", "D"}:
  print("Yes")
else:
  print("No")

Solution (Python):
ss = input()
for n, s in enumerate(ss):
  if s == 'R':
    if (n + 1) % 2 == 0:
      print('No')
      exit()
  elif s == 'L':
    if (n + 1) % 2 == 1:
      print('No')
      exit()
print('Yes')

Solution (Python):
S = input()
yes = True
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            yes = False
            break
    else:
        if S[i] == "R":
            yes = False
            break
            
if yes:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
count = 0
for si,ss in enumerate(s):
    if si%2 == 1 and ss not in ['L','U','D']:
        count += 1
    if si%2 == 0 and ss not in ['R','U','D']:
        count += 1
if count == 0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
S = input()
A = ["R", "U", "D"]
B = ["L", "U", "D"]
for i in range(len(S)):
    if i % 2 == 0:
        if not S[i] in A:
            print("No")
            exit()

    else:
        if not S[i] in B:
            print("No")
            exit()

print("Yes")

Solution (Python):
S=input()
s=len(S)
Sk=[]
Sg=[]
for i in range(0,s,2):
    Sk.append(S[i])
for i in range(1,s,2):
    Sg.append(S[i])
Skx=Sk.count('L')
Sgx=Sg.count('R')
if Skx+Sgx==0:
    print('Yes')
else:
    print('No')

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

Solution (Python):
oddsteps = "RUD"
evensteps = "LUD"
s = input()
n = len(s)
odd = [1 if s[i] in oddsteps else 0 for i in range(0, n, 2)]
even = [1 if s[i] in evensteps else 0 for i in range(1, n, 2)]
if sum(odd) + sum(even) == n:
    print('Yes')
else:
    print('No')

Solution (Python):
def calc(s):
    r = "Yes"
    for i in range(len(s)):
        c = s[i]
        if (i+1) % 2 == 0:
            if c not in ["L", "U", "D"]:
                r = "No"
                break
        else:
            if c not in ["R", "U", "D"]:
                r = "No"
                break
    return r


s = input()

r = calc(s)
print(r)

Solution (Python):
S = input()

ans = "Yes"


Odd = S[::2]
for o in Odd:
  if o == "L":
    ans = "No"


Even = S[1::2]
for e in Even:
  if e == "R":
    ans = "No"

print(ans)

Solution (Python):

s = input()

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

print("Yes")

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

Solution (Python):
s=input()
if len(s)==1:
  if s in {"R","U","D"}:
    print("Yes")
  else:
    print("No")
  exit()
o=set(s[::2])
e=set(s[1::2])
for n in o:
  if n not in {"R","U","D"}:
    print("No")
    exit()
for f in e:
  if f not in {"L","U","D"}:
    print("No")
    exit()
print("Yes")

Solution (Python):
S = input()

ans = True
for i in range(len(S)):
  if S[i] == "D" or S[i] == "U": continue
  else:
    if S[i] == "R" and i % 2 != 0: ans = False
    elif S[i] == "L" and i % 2 == 0: ans = False
      
if ans == True: print("Yes")
else: print("No")

Solution (Python):



def main():


    S = input()

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







if __name__ == "__main__":
    main()

Solution (Python):







S = input()





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

Solution (Python):

S=input()

even=[]
odd=[]

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

odd_flag=True
for o in odd:
    if(o=="R" or o=="U" or o=="D"):
        pass
    else:
        odd_flag=False

even_flag=True
for e in even:
    if(e=="L" or e=="U" or e=="D"):
        pass
    else:
        even_flag=False


if(odd_flag and even_flag):
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
odd = ["R","U","D"]
even = ["L","U","D"]
flag1=True
flag2=True
for i in range(1,len(s)+1):
    if (i%2==1) and not(s[i-1] in odd):
        flag1 =False
    if (i%2==0) and not(s[i-1] in even):
        flag2 = False

if flag1 and flag2:
    print("Yes")
else:
    print("No")

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
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 LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


s = S()
flag = False
for i in s[::2]:
    if i not in ['R', 'U', 'D']:
        flag = True
for j in s[1::2]:
    if j not in ['L', 'U', 'D']:
        flag = True
if flag:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()

i = 1
badFlag = 0
for c in s:
    if i % 2 == 0:
        if not(c == 'L' or c == 'U' or c == 'D'):
            badFlag = 1
    else:
        if not(c == 'R' or c == 'U' or c == 'D'):
            badFlag = 1
    if badFlag == 1:
        break
    i += 1

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