qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	ans = True:
	for i,s in enumerate(S):
		if (i % 2 == 1 and s=='R') or (i % 2 == 0 and s=='L'):
			ans=False
	if(ans):
		print('Yes')
	else:
		print('No')

main()

Fixed code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	ans = True
	for i,s in enumerate(S):
		if (i % 2 == 1 and s=='R') or (i % 2 == 0 and s=='L'):
			ans=False
	if(ans):
		print('Yes')
	else:
		print('No')

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

Fixed code:
s=input()
ng=False
for i in range(len(s)):
  if i%2==0:
    if s[i]=='L':
      ng=True
  else:
    if s[i]=='R':
      ng= True
if ng:
  print('No')
else:
  print('Yes')
Buggy code:
S = str(input())
for i in range(1, len(S), 2):
    if S[i] == "R" or S[i] == "U" or S[i] == "D":
        continue
    else:
        print("No")
        exit()
for i in range(0, len(S), 2):
    if S[i] == "L" or S[i] == "U" or S[i] == "D":
        continue
    else:
        print("No")
        exit()
print("Yes")

Fixed code:
S = str(input())
for i in range(1, len(S), 2):
    if S[i] == "L" or S[i] == "U" or S[i] == "D":
        continue
    else:
        print("No")
        exit()
for i in range(0, len(S), 2):
    if S[i] == "R" or S[i] == "U" or S[i] == "D":
        continue
    else:
        print("No")
        exit()
print("Yes")
Buggy code:
ans="Yes"
s=input()
for i in range(len(s)):
  if i%2==0:
    if s[i]=="R":ans="No"
  else:
    if s[i]=="L":ans="No"
print(ans)

Fixed code:
ans="Yes"
s=input()
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)
Buggy code:
s = input()

flag = True
for i, j in enumerate(s):
    if (i+1) % 2 == 0:
        if not(j == "L" or j =="U" or j == "D"):
            flag = False
    else:
        if not(j == "R" or j =="U", j == "D"):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
flag = True
for i, j in enumerate(s):
    if ( i+1) % 2 == 0:
        if not(j == "L" or j =="U" or j == "D"):
            flag = False
    else:
        if not(j == "R" or j =="U" or  j == "D"):
            flag = False
if flag:
    print("Yes")
else:
    print("No")
Buggy code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      continue
   	else:
      print("No")
      break
  else:
    if s[i] == "L" or "U" or "D":
      continue
    else:
      print("No")
      break
  print("Yes")

Fixed code:
S = list(input())
for i in range(len(S)):
	if i % 2 == 0:
		if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
	else:
		if (S[i] == "L") or(S[i] ==  "U") or(S[i] ==  "D"):
			continue
		else:
			print("No")
			exit()
print("Yes")
Buggy code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    for i, s in enumerate(S):
        if i % 2 == 1 and s == 'R':
            print(i)
            return 'No'
        if i % 2 == 0 and s == 'L':
            return 'No'
    return 'Yes'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()


Fixed code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    for i, s in enumerate(S):
        if i % 2 == 1 and s == 'R':
            return 'No'
        if i % 2 == 0 and s == 'L':
            return 'No'
    return 'Yes'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()
Buggy code:
i = input()
chars = list(i)
if "R" in chars[1::2]:
    if "L" in chars[0::2]:
        print("No")
    else:
        print("No")
else:
    print("Yes")

Fixed code:
i = input()
chars = list(i)
if "R" in chars[1::2]:
    print("No")
elif "L" in chars[0::2]:
    print("No")
else:
    print("Yes")
Buggy code:
S = input()
odd = S[0::2]
even = S[1::2]
ans = 'No'

if odd not in 'L':
    if even not in 'R':
        ans = 'Yes'

print(ans)

Fixed code:
S = input()
odd = S[0::2]
even = S[1::2]
ans = 'No'

if 'L' not in odd:
    if 'R' not in even:
        ans = 'Yes'

print(ans)
Buggy code:
ugrd={'L'}
grd={'R'}
s=string(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  elif i==len(s)-1:
    print('Yes')

Fixed code:
ugrd={'L'}
grd={'R'}
s=str(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  if i==len(s)-1:
    print('Yes')
Buggy code:
S=input()
N = len(S)
ans=0
for i in range(N+1):
    if i%2==0:
        if S[i]=='L':
            print('No')
        else:
            ans+=1
    else:
        if S[i]=='R':
            print('No')
        else:
            ans+=1
if ans==2:
    print('Yes')

Fixed code:
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')
Buggy code:
S=input()
x=0
for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

Fixed code:
S=input()
x=0
if len(S)%2==1:
 for i in range(len(S)//2+1):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x
else:
 for i in range(len(S)//2):
  if S[2*i]=='L':
    x= x+1
  else:
    x= x

for j in range(len(S)//2):  
  if S[2*j+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')
Buggy code:
s=input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s)) else "No")

Fixed code:
s=input()
print("Yes" if all((i%2==0 and s[i] in "RUD") or (i%2!=0 and s[i] in "LUD") for i in range(len(s))) else "No")
Buggy code:
a = input()
if len(a)==1 and a == "L":
    print("No")
    exit()
elif len(a)==1:
    print("Yes")
    exit()
for i in a[::2]:
    for j in a[1::2]:
        print(i,j)
        if i =="L" or j =="R":
            print("No")
            exit()
else:
    print("Yes")

Fixed code:
a = input()
if len(a)==1 and a == "L":
    print("No")
    exit()
elif len(a)==1:
    print("Yes")
    exit()
for i in a[::2]:
    for j in a[1::2]:
        if i =="L" or j =="R":
            print("No")
            exit()
else:
    print("Yes")
Buggy code:
S = str(input())
step_count = 0
ans='Yes'
for step in S:
    step_count += 1
    if step_count%2:
        if step == 'L':
            ans='No'
            brake
            
    else:
        if step == 'R':
            ans='No'
            brake
print(ans)

Fixed code:
S = str(input())
step_count = 0
ans='Yes'
for step in S:
    step_count += 1
    if step_count%2:
        if step == 'L':
            ans='No'
            break
            
    else:
        if step == 'R':
            ans='No'
            break
print(ans)
Buggy code:
S = input()

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

print(flag)

Fixed code:
S = input()

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

print(flag)
Buggy code:
import numpy as np
S = list(map(str,input().split()))
S = [c for c in S[0]]

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

Fixed code:
import numpy as np
S = list(map(str,input().split()))
S = [c for c in S[0]]

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

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
        
print(result)

Fixed code:
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
    cnt += 1
print(result)
Buggy code:
s=list(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)

Fixed code:
import sys
s=list(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")
Buggy code:
s = input()

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

Fixed code:
S = input()
print("No" if 'L' in S[::2] or 'R' in S[1::2] else "Yes")
Buggy code:
b = True
s = input()
for i in range(0, len(s)):
  if(i % 2 == 0):
    if s[i] == 'R':
      b = False
  else:
    if s[i] == 'L':
      b = False
if b:
  print("Yes")
else:
  print("No")

Fixed code:
b = True
s = input()
for i in range(0, len(s)):
  if(i % 2 == 1):
    if s[i] == 'R':
      b = False
  else:
    if s[i] == 'L':
      b = False
if b:
  print("Yes")
else:
  print("No")
Buggy code:
s=input()
a=0
for i in range (0,len(s)):
  if s[i]=="U"or"D":
    a=a
  elif i%2==0:
    if s[i]=="L":
      a=a+1
  else:
    if s[i]=="R":
      a=a+1
if a==0:
  print("Yes")
else:
  print("No")

Fixed code:
s=input()
a=0
for i in range (0,len(s)):
  if s[i]=="R"or"L":
    if i%2==0:
      if s[i]=="L":
        a=a+1
    else:
      if s[i]=="R":
        a=a+1
if a==0:
  print("Yes")
else:
  print("No")
Buggy code:
s = input()
for i in range(len()s):
  if i % 2 == 0 && s[i] == "R":
    print("No")
    exit()
  elif i % 2 == 1 %% s[i] == "L":
    print("No")
    exit()
print("Yes")

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

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

Fixed code:
s = input()
 
for i in range(len(s)):
	if i%2==1 and s[i]=='R':
		print('No')
		exit()
	elif i%2==0 and s[i]=='L':
		print('No')
		exit()
 
print('Yes')
Buggy code:
s = list(input())
a = s[::2]
b = s[1::2]
if a.count(L) == 0 and b.count(R) == 0:
  print('Yes')
else:
  print("No")

Fixed code:
s = list(input())
a = s[::2]
b = s[1::2]
if a.count('L') == 0 and b.count('R') == 0:
  print('Yes')
else:
  print("No")
Buggy code:
s = input()
ans = 'Yes'
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == 'L':
            ans = 'No'
    else:
        if s[i] == 'R':
            ans = 'Yes'
print(ans)


Fixed code:
s = list(input())
ans = 0
for i in range (len(s)):
         if i % 2 == 0:
                  if s[i] == "L":
                           ans = 1
         else:
                  if s[i] == "R":
                           ans = 1
if ans == 1:
         print("No")
else:
         print("Yes")
Buggy code:
S=input()

p=True
q=True
for i in S:
  if p:
    if not i=='L':
      p=False
	else:
      q=False
      break
  else:
    if not i=='R':
      p=True
    else:
      q=False
      break
      
print ("Yes" if q else "No")

Fixed code:
S=input()

p=True
q=True
for i in S:
  if p:
    if not i=='L':
      p=False
    else:
      q=False
      break
  else:
    if not i=='R':
      p=True
    else:
      q=False
      break

print ("Yes" if q else "No")
Buggy code:
s = input()
valid = True
for i in range(len(s)):
    if i % 2 == 0:
        if not (s[i] in ['L', 'U', 'D']):
            valid = False
            break
    else:
        if not (s[i] in ['R', 'U', 'D']):
            valid = False
            break
if valid:
    print("Yes")
else:
    print("No")


Fixed code:
s = input()
valid = True
for i in range(len(s)):
    if i % 2 == 1:
        if not (s[i] in ['L', 'U', 'D']):
            valid = False
            break
    else:
        if not (s[i] in ['R', 'U', 'D']):
            valid = False
            break
if valid:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
odd = s[::2]
even = s[1::2]
if 'L'  in odd and 'R'  in even:
    print('No')
else:
    print('Yes')

Fixed code:
s = input()
odd = s[::2]
even = s[1::2]
if 'L'  in odd or 'R'  in even:
    print('No')
else:
    print('Yes')
Buggy code:
N=str(input())
if 'R' in N[0::2] or 'L' in N[1::2]:
    print('No')
else:
    print('Yes')

Fixed code:
N=str(input())
if 'L' in N[0::2] or 'R' in N[1::2]:
    print('No')
else:
    print('Yes')
Buggy code:
# -*- coding: utf-8 -*-
s = input()

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

Fixed code:
# -*- coding: utf-8 -*-
s = input()

for i in range(0,len(s)):
  if (i%2==0)and(s[i]=="L"):
    print("No")
    exit()
  elif (i%2==1)and(s[i]=="R"):
    print("No")
    exit()
print("Yes")
Buggy code:
S = input()
if all([x in ['R', 'U', 'D'] for x in S[::2]]):
    print('Yes')
elif all([x in ['L', 'U', 'D'] for x in S[1::2]]):
    print('Yes')
else:
    print('No')

Fixed code:
S = input()
if all([x in ['R', 'U', 'D'] for x in S[::2]]) and all([x in ['L', 'U', 'D'] for x in S[1::2]]):
    print('Yes')
else:
    print('No')
Buggy code:
import re

s = input()
pattern = re.compile(r'^([^L][^R])*[L]?$')
is_easy_to_dance = pattern.match(s)

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

Fixed code:
import re

s = input()

pattern = re.compile(r'^([^L][^R])*[^L]?$')
is_easy_to_dance = pattern.match(s)

print("Yes") if is_easy_to_dance else print("No")
Buggy code:
s=input()
flg=False

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


Fixed code:
s=input()
flg=False

for i in range(len(s)):
  if (i+1)%2==0 and s[i]=='R':
    flg=True
  if (i+1)%2==1 and s[i]=='L':
    flg=True
if flg:
  print('No')
else:
  print('Yes')
Buggy code:
s = list(input())
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "L":
        print("No")
        return
    if i % 2 != 0 and s[i] == "R":
        print("No")
        return
print("Yes")

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

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

Fixed code:
s=input()
 
ans="Yes"
for i in range(len(s)):
  if i%2==0 and s[i]=="L":
    ans="No"
  if i%2!=0 and s[i]=="R":
    ans="No"
    
print(ans)
Buggy code:
bool ans = True
S = input()
i = 0
while i < len(S):
  if S[i] == "L":
    ans = False
  i += 2
j = 1
while j < len(S):
  if S[j] == "R":
    ans = False
  j += 2
if ans:
  print("Yes")
else:
  print("No")

Fixed code:
ans = True
S = input()
i = 0
while i < len(S):
  if S[i] == "L":
    ans = False
  i += 2
j = 1
while j < len(S):
  if S[j] == "R":
    ans = False
  j += 2
if ans:
  print("Yes")
else:
  print("No")
Buggy code:
S = list(input())

O = [i for i in range(len(S)) if i % 2 == 0]
E = [i for i in range(len(S)) if i % 2 == 1]

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


Fixed code:
S = list(input())

O = [S[i] for i in range(len(S)) if i % 2 == 0]
E = [S[i] for i in range(len(S)) if i % 2 == 1]

if "L" in O or "R" in E:
  print("No")
else:
  print("Yes")
Buggy code:
s = input()
ans = "Yes"
for i in 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)    

Fixed code:
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)
Buggy code:
str = input()

list = str.split()
i = 0
f = True
for l in list:
    i+=1
    if i%2 == 0:
        if l == "R":
            f=False
            break
    else:
        if l == "L":
            f=False
            break
if(f):
    print("Yes",end="\n")
else:
    print("No",end="\n")

Fixed code:
str = input()

list = list(str)

i = 0
f = True
for l in list:
    i+=1
    if i%2 != 0:
        if l == "L":
            f=False
            break
    else:
        if l == "R":
            f=False
            break

if(f):
    print("Yes",end="\n")
else:
    print("No",end="\n")
Buggy code:
S = list(input())

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


Fixed code:
S = list(input())

for i in range(len(S)):
    if i % 2 == 1:
        if S[i] not in ["L", "U", "D"]:
            print("No")
            exit()
    else:
        if S[i] not in ["R", "U", "D"]:
            print("No")
            exit()
print("Yes")
Buggy code:
S=input()
num=1
ans="No"
while True:
  word=S[0]
  if num%2==1 :
    if not (word=="R") or (word=="U") or (word=="D") :
      break
  else:
    if not (word=="L") or (word=="U") or (word=="D") :
      break
  if len(S)==1 :
    ans="Yes"
    break
  S=S[1:]
  num+=1
  
print(ans)

Fixed code:
S=input()
num=1
ans="No"

while True:
  word=S[0]
  if num%2==1 :
    if  (word=="R") or (word=="U") or (word=="D") :
      if len(S)==1 :
        ans="Yes"
        break
      S=S[1:]
      num+=1
      continue
  else:
    if (word=="L") or (word=="U") or (word=="D") :
      if len(S)==1 :
        ans="Yes"
        break
      S=S[1:]
      num+=1
      continue
  break
      
print(ans)
Buggy code:
S = list(input())
a = 0

for i in range(len(S)):
    if S[i%2] == "R" or S[i%2] == "U" or S[i%2] == "D":
        pass
    elif S == "L" or S == "U" or S == "D":
        pass
    else:
        a=1

if a == 1:
    print("No")

else:
    print("Yes")

Fixed code:
S = list(input())
a = 0

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


    
if a == 1:
    print("No")

else:
    print("Yes")
Buggy code:
S=input()
flag=False
for i in range(len(S)):
  if i%2==0:
    if S[i]!='R' and S[i]!='U' and S[i]!='D':
      flag=True
  else:
    if S[i]!='L' and S[i]!='U' and S[i]!='D':
      flag=True
if flag=True:
  print('No')
else:
  print('Yes')

Fixed code:
S=input()
flag=False
for i in range(len(S)):
  if i%2==0:
    if S[i]!='R' and S[i]!='U' and S[i]!='D':
      flag=True
  else:
    if S[i]!='L' and S[i]!='U' and S[i]!='D':
      flag=True
if flag==True:
  print('No')
else:
  print('Yes')
Buggy code:
s = input()

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

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

Fixed code:
s = input()
 
flag = True
for i in range(len(s)):
  if i%2 == 0 and s[i] == "L":
    flag = False
  if i%2 == 1 and s[i] == "R":
    flag = False
 
if flag:
  print("Yes")
else:
  print("No")
Buggy code:
s = input()
'''
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

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

print('Yes')

'''

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


Fixed code:
s = input()
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

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

print('Yes')
Buggy code:
S = input()

odd = {c for i, c in enumerate(S, 1) if i % 2 != 0}
even = {c for i, c in enumerate(S, 1) if i % 2 == 0}

if odd == { 'R', 'U', 'D' } and even == { 'L', 'U', 'D' }:
  print('Yes')
else:
  print('No')


Fixed code:
S = input()

odd = {c for i, c in enumerate(S, 1) if i % 2 != 0}
even = {c for i, c in enumerate(S, 1) if i % 2 == 0}

if odd.issubset({ 'R', 'U', 'D' }) and even.issubset({ 'L', 'U', 'D' }):
  print('Yes')
else:
  print('No')