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 = list(input())
print("Yes" if all(s in ("R", "U", "D") for s in S[::2]) and all(s in ("L", "U", "D") for s in S[1::2]) else "No")

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()

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

print('Yes')

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

if easy:
    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
            break
    else:
        if S[i]=='L':
            f=False
            break
if f: print('Yes')
else: print('No')

Solution (Python):
s = input().rstrip()
evens = ["L", "U", "D"]
odds = ["R", "U", "D"]
is_easy = True
for i, ch in enumerate(s):
    if i % 2 == 0:
        if ch not in odds:
            is_easy = False
    else:
        if ch not in evens:
            is_easy = False
if is_easy:
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
S = input()

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

Solution (Python):
s=input()
flag=0
for i in s[::2]:
    if i not in ["R","U","D"]:
        flag=1

for i in s[1::2]:
    if i not in ["L","U","D"]:
        flag=1

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

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

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

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

for i in range(len(S)):
    if i%2!=0:
        if not S[i] in Guusuu:
            print('No')
            exit()
    else:
        if not S[i] in Kisuu:
            print('No')
            exit()
print('Yes')

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

Solution (Python):
import sys
input = sys.stdin.readline

s = input().split()
s = list(s[0])

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()
flag = True
for i, s in enumerate(S):
    if i % 2 == 1 and s == 'R':
        flag = False
        break
    elif i % 2 == 0 and s == 'L':
        flag = False
        break

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

Solution (Python):
S = input()
kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']
flag = True
for i in range(len(S)):
    if i%2==0:
        if S[i] in kisu:
            continue
        else:
            flag = False
    else:
        if S[i] not in gusu:
            flag = False
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
S=input()
j=0
for i in S:
    if j==1 and i=="R":
        print("No")
        exit()
    if j==0 and i=="L":
        print("No")
        exit()
    j=1-j
print("Yes")

Solution (Python):
S = input()

S1 = set(S[::2])
S2 = set(S[1::2])

if len(S1-set(["R","U","D"])) > 0:
    print("No")
    exit()
if len(S2-set(["L","U","D"])) > 0:
    print("No")
    exit()
print("Yes")

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

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

print(ans)

Solution (Python):

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

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

Solution (Python):
S = input()

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

flag = True
for i in range(len(S)):
    
    if i % 2 == 0:
        if S[i] not in A:
            flag = False
    else:
        if S[i] not in B:
            flag = False

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

Solution (Python):
import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)




def main():
    s = input()

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

    print('Yes')


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
ans = True
for i, v in enumerate(s):
    i += 1
    if i % 2:
        if not v in ['R', 'U', 'D']:
            ans = False
            break
    else:
        if not v in ['L', 'U', 'D']:
            ans = False
            break

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

Solution (Python):
S = input()

flag = True

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

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

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

Solution (Python):
S = input()

humi = 1
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] not in ['R', 'U', 'D']:
            humi *= 0
            break
    if i % 2 == 1:
        if S[i] not in ['L', 'U', 'D']:     
            humi *= 0
            break
if humi == 1:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

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

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

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

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

Solution (Python):
def main():
    ls = list(input())
    for i,now in enumerate(ls):
        if i%2 == 0:
            if now in ["R","U","D"]:
                pass
            else:
                print("No")
                exit()
        else:
            if now in ["L","U","D"]:
                pass
            else:
                print("No")
                exit()
    print("Yes")
if __name__ == "__main__":
    main()

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	S = input()
	S = S[:-1]

	flg = True

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

	for i in range(1,len(S),2):
		if S[i] == "L" or S[i] == "U" or S[i] == "D":
			continue
		else:
			print("No")
			sys.exit()

	print("Yes")



if __name__ == "__main__":
	main()

Solution (Python):
S = input()

ans = True
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] not in ['R', 'U', 'D']:
            ans = False
            break
    else:
        if S[i] not in ['L', 'U', 'D']:
            ans = False
            break
print('Yes' if ans else 'No')

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

Solution (Python):
S = input()
res = [1 for i,x in enumerate(S) if ((i+1)%2==0 and x in ['L','U','D']) or ((i+1)%2!=0 and x in ['R','U','D'])]
if sum(res)==len(S):
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()

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

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

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

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

if "L" in O or "R" in E:
    print("No")
else:
    print("Yes")

Solution (Python):
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    for i in range(len(S)):
        if S[i] == "L" and (i + 1) % 2 == 1:
            No()
            exit()
        if S[i] == "R" and (i + 1) % 2 == 0:
            No()
            exit()
    Yes()

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
f = True
for i in range(0,len(s)):
    if i%2 == 0:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            f = False
            break
    else:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            f = False
            break
if f:
    print('Yes')
else:
    print('No')

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

Solution (Python):
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

S = stdin.readline().rstrip()

for i, s in enumerate(S):
    
    if (i+1) % 2 != 0:
        if s in ["R", "U", "D"]:
            pass
        else:
            print("No")
            exit()

    else:
        if s in ["L", "U", "D"]:
            pass
        else:
            print("No")
            exit()


print("Yes")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def solve(S: str):

    for i, s in enumerate(S):
        if (i+1) % 2 == 1:
            if s == "L":
                print(NO)
                return
        else:
            if s == "R":
                print(NO)
                return

    print(YES)


    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

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

Solution (Python):
S = input()

easy = True

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

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

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


if __name__ == '__main__':
    main()

Solution (Python):
from heapq import heappush, heappop
import queue
import re
import math
import functools

def s_raw():
    return input().rstrip("\r")

def int_raw():
    return int(input())


def ss_raw():
    return input().split()


def ints_raw():
    return list(map(int, ss_raw()))


INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


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


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    

def main():
    TS = [["R", "U", "D"], ["L", "U", "D"]]
    S = s_raw()
    for idx,c in enumerate(S):
        if not(c in TS[idx%2]):
            return "No"
    
    return "Yes"

if __name__ == "__main__":
    print(main())

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

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

Solution (Python):
S = str(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):
S = input()
S_ki = S[0::2]
S_gu = S[1::2]

import sys
for k in S_ki:
    if k == "L":
        print("No")
        sys.exit()
for g in S_gu:
    if g == "R":
        print("No")
        sys.exit()
print("Yes")

Solution (Python):
S=input()

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    b = True
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] == "R" or s[i] == "U" or s[i] == "D":
                b = True
            else:
                b = False
                break
        else:
            if s[i] == "L" or s[i] == "U" or s[i] == "D":
                b = True
            else:
                b = False
                break
    if b:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    slove()

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

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

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

Solution (Python):
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

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


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
cond = True
for i in range(0,len(S),2):
	if S[i] == "L":
		cond = False
for i in range(1,len(S),2):
	if S[i] == "R":
		cond = False

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

Solution (Python):
s = input()

l = len(s)

ok = True
for i in range(l):
    if i % 2 == 1:
        if s[i] == 'R':
            ok = False
    if i % 2 == 0:
        if s[i] == 'L':
            ok = False

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

Solution (Python):
S = input()
N = len(S)
f = True
for i in range(N):
  if i%2 == 1:
    if S[i] == "L" or S[i] == "U" or S[i] == "D":
      pass
    else:
      f = False
  else:
    if S[i] == "R" or S[i] == "U" or S[i] == "D":
      pass
    else:
      f = False
    
if f:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()

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

print("Yes")

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[::2]
even = S[1::2]
if ('L' in odd) or ('R' in even):
    print('No')
else:
    print('Yes')

Solution (Python):
import sys, random
mod = 1000000007
def get_array(): return list(map(int, sys.stdin.readline().split()))
def get_ints(): return map(int, sys.stdin.readline().split())
def input(): return sys.stdin.readline()
def print_array(a): print(" ".join(map(str, a)))
def main():
        s = input().strip()
        l = len(s)
        flag = True
        for i in range(0, l):
                if (i % 2 == 0) and s[i] not in ['R', 'U', 'D']:
                        flag = False
                        break
                if i % 2 == 1 and s[i] not in ['L', 'U', 'D']:
                        flag = False
                        break
        print("Yes" if flag else "No")
if __name__ == "__main__":
        main()

Solution (Python):
S = input()

o = S[::2]
e = S[1::2]

if o.count('R') + o.count('U') + o.count('D') == len(o) and e.count('L') + e.count('U') + e.count('D') == len(e) :
    print('Yes')
else :
    print('No')

Solution (Python):
s = input()

a = set()
a.add('R')
a.add('U')
a.add('D')

b = set()
b.add('L')
b.add('U')
b.add('D')

flag = 1
for i, si in enumerate(s):
    if i % 2 == 0 and si not in a:
        flag = 0

for i, si in enumerate(s):
    if i % 2 == 1 and si not in b:
        flag = 0

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

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

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

ans = "Yes"
for i in range(len(s)):
    if i%2 == 0:
        if s[i] not in a:
            ans ="No"
    else:
        if s[i] not in b:
            ans = "No"
print(ans)

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

Solution (Python):
s=input()
i=0
f=0
for ss in s:
    if i%2==0:
        if ss=='L':
            f=1
            break
    else:
        if ss=="R":
            f=1
            break
    i+=1
if f==0:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

ans = 'Yes'
for i, s in enumerate(S):
    if (i+1)%2==1:
        if s=='L':
            ans = 'No'
    else:
        if s=='R':
            ans = 'No'

print(ans)

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

Solution (Python):
import sys
import math
import re

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

Solution (Python):

def main():
    S = input().rstrip()
    odd, even = set(S[::2]), set(S[1::2])
    flg = odd <= {"R", "U", "D"} and even <= {"L", "U", "D"}
    print("Yes" if flg else "No")


if __name__ == "__main__":
    main()

Solution (Python):
S = input()
odd, even = S[::2], S[1::2]
print('Yes' if set(odd) <= set('RUD') and set(even) <= set('LUD') else 'No')

Solution (Python):
S=input()
r=1
for i,c in enumerate(S):
    if i%2==0 and c=='L' or i%2==1 and c=='R':
        r=0
print(['No','Yes'][r])

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

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

Solution (Python):
s = input()
ans = "Yes"
for key,i in enumerate(s):
  if (key+1) % 2:
    if i == "L":
      ans = "No"
      break
  else:
    if i == "R":
      ans = "No"
      break
print(ans)

Solution (Python):
import sys

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")
            sys.exit()
    else:
        if not (S[i] == 'L' or S[i] == 'U' or S[i] == 'D'):
            print("No")
            sys.exit()
print("Yes")

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

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

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

Solution (Python):
S = input()
flag = True
for i, s in enumerate(S):
    if i % 2 == 0:
        if s == "L":
            flag = False
            break
    else:
        if s == "R":
            flag = False
            break

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

Solution (Python):
s = list(input())
ok = True
for i, c in enumerate(s):
    if i % 2 == 0 and (c not in list('RUD')):
        ok = False
    if i % 2 != 0 and (c not in list('LUD')):
        ok = False
if ok:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()
O = ['R','U','D']
E = ['L','U','D']
flag = True
for i in range(len(S)):
  if i%2 == 0:
    if S[i] not in O:
      flag = False
      break
  else:
    if S[i] not in E:
      flag = False
      break
if flag:
  print('Yes')
else:
  print('No')

Solution (Python):
from sys import stdin

S = stdin.readline().rstrip()

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

print('Yes')

Solution (Python):
S = input()
good = 1
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "R" or S[i] == "U" or S[i] == "D":
            
            good = good
        else:
            good = 0
    else:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
            
            good = good
        else:
            good = 0

if not good:
    print("No")
else:
    print("Yes")

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

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[::2]
even = S[1::2]
if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
import collections
import copy
import math
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
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
    if i == len(S)-1:
        print("Yes")

Solution (Python):

s = input()
r_set = set(["R", "U", "D"])
l_set = set(["L", "U", "D"])


ans = "No"
if set(s[::2]).issubset(r_set) and set(s[1::2]).issubset(l_set):
    ans = "Yes"
print(ans)

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

Solution (Python):
s=input()
f=True
for i in range(len(s)):
	if i%2==0:
		if s[i]=='L':f=False
	else:
		if s[i]=='R':f=False

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

Solution (Python):
n=list(input())
for i,j in enumerate(n):
    if i%2==0:
        if j in "RUD":
            continue
        else:
            print("No")
            exit()
    else:
        if j in "LUD":
            continue
        else:
            print("No")
            exit()
print("Yes")

Solution (Python):
import sys

s = input()

for si in s[0::2]:
  if si not in ["R", "U", "D"]:
    print("No")
    sys.exit(0)

for si in s[1::2]:
  if si not in ["L", "U", "D"]:
    print("No")
    sys.exit(0)

print("Yes")

Solution (Python):
s=input()

ans = 'Yes'
for i, t in enumerate(s):
    if i % 2 == 0:
        if t in ['R','U','D']:
            pass
        else:
            ans = 'No'
    else:
        if t in ['L','U','D']:
            pass
        else:
            ans = 'No'
print(ans)

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

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()
f = True

for i, s in enumerate(s):
  if i % 2 == 0:
    if not s in ['R', 'U', 'D']:
      f = False
      break
  else:
    if not s in ['L', 'U', 'D']:
      f = False
      break
      
if f:
  print('Yes')
else:
  print('No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str):
    flag = True
    for i, s in enumerate(S):
        if i % 2 == 0:
            if s not in ["R", "U", "D"]:
                flag = False
        else:
            if s not in ["L", "U", "D"]:
                flag = False
    if flag:
        print(YES)
    else:
        print(NO)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

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

Solution (Python):
a = "Yes"
data = input()

for i in range(len(data)):
  if (i%2 == 0 and data[i]=="L") or (i%2 == 1 and data[i]=="R"):
    a = "No"
print(a)

Solution (Python):
S = input()

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

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

Solution (Python):
s=input()
print('Yes' if s[::2].find('L')+s[1::2].find('R') == -2 else 'No')

Solution (Python):
import re
if re.match('^([RUD][LUD])*[RUD]?$', input()):
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()
ok = True
for i in range(len(S)):
  c = S[i]
  if i%2 == 0:
    if c not in "RUD":
      ok = False
      break
  if i%2 == 1:
    if c not in "LUD":
      ok = False
      break
if ok:
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
easy = True
for i, s in enumerate(S):
    if i%2 == 0 and s == 'L':
        easy = False
        break
    if i%2 == 1 and s == 'R':
        easy = False
        break
print('Yes' if easy else 'No')

Solution (Python):
import math
S = input()

odds = ["R","U","D"]
evens = ["L","U","D"]
ans = "Yes"
for i,c in enumerate(S):
    if (i + 1) % 2 == 1:
        if c not in odds:
            ans = "No"
    else:
        if c not in evens:
            ans = "No"

print(ans)