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()
oddLst=['R','U','D']
evenLst=['L','U','D']

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

print(ret)

Solution (Python):
S = input()
for_num = 0

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

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

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

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

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

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

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


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

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


class Scan():

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

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


main()

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


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

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


class Scan():

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

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


main()

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

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

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

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

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

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

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

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

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

print("Yes")

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

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

    count += 1

print(ans)

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

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

Solution (Python):
S = input()

odd_number = []
even_number = []

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

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

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

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

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

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

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

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

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

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

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()

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

Solution (Python):
S = input()

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

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

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

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

Solution (Python):
import sys


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



if __name__ == '__main__':
    solve()

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

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

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

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

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

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

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

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

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

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

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

print(a)

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

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

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

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

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

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

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

print(res)

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

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

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()
for i in range(0, len(s)):
    if i%2 == 0:
        if s[i] is 'L':
            print('No')
            exit(0)
    if i%2 == 1:
        if s[i] is 'R':
            print('No')
            exit(0)
print('Yes')

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

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

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

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

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

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

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

Solution (Python):
import sys


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


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


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



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



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



def C():
    return



def D():
    return



def E():
    return



def F():
    return



def resolve():
    B()
    return



if __name__ == "__main__":
    B()

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

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

Solution (Python):
import sys
s = list(input())
n = len(s)

for i in range(n):
    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()

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

Solution (Python):
s=input()

sodd=[s[2*i] for i in range((len(s)+1)//2)]
seven=[s[2*i+1] for i in range((len(s))//2)]

if ("L" in sodd) or ("R" in seven):
    print("No")
else:
    print("Yes")

Solution (Python):
odd = ["R","U","D"]
even = ["L","U","D"]

def tap(S):
    for i,s in enumerate(S):
        if ((i + 1)%2 != 0):
            if s in odd:
                continue
            else:
                print("No")
                return
        else:
            if s in even:
                continue
            else:
                print("No")
                return
    print("Yes")


S = list(input())
tap(S)

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

if __name__ == '__main__':
    main()

Solution (Python):
def main():
  line = input()
  
  ki = ['R', 'U', 'D']
  gu = ['L', 'U', 'D']

  for i in range(len(line)):
    if (i+1) % 2 == 0:
      if line[i] not in gu:
        print("No")
        return
    else:
      if line[i] not in ki:
        print("No")
        return
      
  print("Yes")
  return

main()

Solution (Python):


S = input()

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

for (i, step) in enumerate(S):
    if i % 2:
        if step not in even:
            print("No")
            exit()
    else:
        if step not in odd:
            print("No")
            exit()

print("Yes")

Solution (Python):
S = input()
stepr = ["R", "U", "D"]
stepl = ["L", "U", "D"]
rstep = all([S[i] in stepr for i in range(0,len(S),2)])
lstep = all([S[i] in stepl for i in range(1,len(S),2)])
if rstep and lstep:
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
check=0
for i in S[1::2]:
  if i in 'LUD':
    check+=1
for j in S[::2]:
  if j in 'RUD':
    check+=1
print('Yes' if check==len(S) else 'No')

Solution (Python):
def judgeOdd(x: str):
    if x != "L":
        return True
    else:
        return False


def judgeEven(x: str):
    if x != "R":
        return True
    else:
        return False


if __name__ == "__main__":
    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]

    odd = list(map(judgeOdd, odd))
    even = list(map(judgeEven, even))

    if False in odd or False in even:
        print("No")
    else:
        print("Yes")

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

Solution (Python):
s = input()

ans = 'Yes'
so = [s[i] for i in range(0,len(s),2)]
se = [s[i] for i in range(1,len(s),2)]

for i in so:
    if i == 'L':
        ans = 'No'

for i in se:
    if i == 'R':
        ans = 'No'
print(ans)

Solution (Python):
s = input()

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

Solution (Python):
s = input().strip()

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

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

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

Solution (Python):
s=input()

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

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

Solution (Python):
S=input()
ans="Yes"

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

print(ans)

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

Solution (Python):
strs = input()
 
for i in range(len(strs)):
  if i % 2 != 0:
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      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':
            print('No')
            flag = 1
    else:
        if s[i] == 'R':
            print('No')
            flag = 1
    if flag == 1:
        break
if flag == 0:
    print('Yes')

Solution (Python):
S_list = list(input())
even = ['R','U','D']
odd = ['L','U','D']
odd1 = S_list[0::2]
even1 = S_list [1::2]

if 'L' in odd1 or 'R' in even1:
    print('No')

else:
    print('Yes')

Solution (Python):
s = input()
a = [str(c) for c in s]


b = a[0::2]
c = a[1::2]


if "L" in b:
    d = False
else:
    d = True


if "R" in c:
    f = False
else:
    f = True

if d and f:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

odd_tap = ['R', 'U', 'D']
even_tap = ['L', 'U', 'D']

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

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

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

Solution (Python):
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!=0 and s[i]=='L':
        print("No")
        exit(0)
print("Yes")

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

Solution (Python):
import sys

S = list(input())

Wid = len(S)

for i in range(0, Wid):
  if i % 2 == 0 and S[i] == "L":
    print("No")
    sys.exit()
  elif i % 2 != 0 and S[i] == "R":
    print("No")
    sys.exit()
print("Yes")

Solution (Python):
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall

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

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

Solution (Python):
s=input()
x=0
for i in range(0,len(s),2):
  if s[i]=="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]=="R":
    x+=1

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

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

Solution (Python):
import sys
S = input()
Odd = []
Even = []
for i,s in enumerate(S):
    if (i+1) % 2 == 1:
        Odd.append(s)
    else:
        Even.append(s)

for odd in Odd:
    if odd == 'L':
        print('No')
        sys.exit()
for even in Even:
    if even == 'R':
        print('No')
        sys.exit()

print('Yes')

Solution (Python):
s=input().strip()
c=0
for i in s:
    c+=1
    if c%2:
        if i not in ['R', 'U', 'D']:
            print('No')
            exit(0)
    else:
        if i not in ['L', 'U', 'D']:
            print('No')
            exit(0)
print('Yes')

Solution (Python):
s = input()

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

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()

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)

Solution (Python):
s = input()
id = 0
res = 'Yes'
for i in s:
    if id & 1 == 0 and i == 'L' or id & 1 == 1 and i == 'R':
        res = 'No'
        break
    id += 1
print(res)

Solution (Python):
S=list(input())
a=0
for j in range(0,len(S),2):
    if S[j]=="R" or S[j]=="U" or S[j]=="D":
        a+=1
for i in range(1,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
if a==len(S):
    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+1) % 2 == 0:
        if s[i] not in even:
            print('No')
            exit()
    else:
        if s[i] not in odd:
            print('No')
            exit()
print('Yes')

Solution (Python):
letters = ["L", "R", "U", "D"]
odd = "RUD"
even = "LUD"
S = input()
i = 0
result = "Yes"
for s in S:
  if i % 2 == 0:
    if s not in odd:
      result = "No"
      break
  else:
    if s not in even:
      result = "No"
      break
  i+=1

print(result)

Solution (Python):
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")
            exit(0)
    else:
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print("No")
            exit(0)

print("Yes")

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

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

Solution (Python):

S = str(input())

res = True
for i, ch in enumerate(S):
    if i%2 == 0:
        if ch == 'L':
            res = False
            break
    else:
        if ch == 'R':
            res = False
            break

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

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

S = input()
odd = True
even = True

for i in range(len(S)):
    if (i+1)%2==0:
        if S[i] == "R":
            even = False
    else:
        if S[i] == "L":
            odd = False
    if (odd and even) == False:
        print("No")
        exit()

print("Yes")

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

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

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

Solution (Python):
import sys

S=str(input())

for a in range(len(S)):
    if a%2==0:
        if S[a]=='R' or S[a]=='U' or S[a]=='D':
            continue
    elif a%2==1:
        if S[a]=='L' or S[a]=='U' or S[a]=='D':
            continue
    
    print('No')
    sys.exit()

print('Yes')

Solution (Python):
S=input()
i=0
while i<len(S):
  if i%2==0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
      exit()
    else:
      i+=1
print("Yes")

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

def check_humiyasu(S):
    count = 0

    for i in range(len(S)):
        if (i+1) % 2 == 0:
            if S[i] == "L" or S[i] == "U" or S[i] == "D":
                continue
            else:
                count += 1
                
                

        elif (i+1) % 2 != 0:
            if S[i] == "R" or S[i] == "U" or S[i] == "D":
                continue
            else:
                count += 1
                
                
    if count == 0:
        print("Yes")
    else:
        print("No")

check_humiyasu(S)

Solution (Python):
s = input()
tap_odd = ["R", "U", "D"]
tap_even =  ["L", "U", "D"]
flg = 0
for i in range(len(s)):
    if i % 2 !=0 and s[i] in tap_even:
        pass
    elif i % 2 ==0 and s[i] in tap_odd:
        pass
    else:
        flg = 1
        break
if flg == 1:
    print("No")
else:
    print("Yes")

Solution (Python):



def solve(*args: str) -> str:
    s = args[0]
    return 'Yes' if (
        s[0::2].count('L') == 0 and
        s[1::2].count('R') == 0
    ) else 'No'


if __name__ == "__main__":
    print(solve(*[input() for _ in range(1)]))

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

odd_s = S[0::2]
even_s = S[1::2]
o,e = True,True
for i in odd_s:
    if i not in odd:
        o = False
for i in even_s:
    if i not in even:
        e = False
        
if o and e:
    print("Yes")
else:
    print("No")

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

Solution (Python):
S = input()

check1 = ["R","U","D"]
check2 = ["L","U","D"]

check1_ = []
check2_ = []

for s in S[::2]:
  if s in check1:
    check1_.append(True)
  else:
    check1_.append(False)

for s in S[1::2]:
  if s in check2:
    check2_.append(True)
  else:
    check2_.append(False)

if all(check1_) and all(check2_):
  print("Yes")
else:
  print("No")