Problem:


Score: 200 points

Problem Statement

Takahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.

S is said to be easily playable if and only if it satisfies both of the following conditions:

Every character in an odd position (1-st, 3-rd, 5-th, \ldots) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th, \ldots) is L, U, or D.

Your task is to print Yes if S is easily playable, and No otherwise.

Constraints

S is a string of length between 1 and 100 (inclusive).

Each character of S is L, R, U, or D.

Input

Input is given from Standard Input in the following format:

S

Output

Print Yes if S is easily playable, and No otherwise.

Sample Input 1

RUDLUDR

Sample Output 1

Yes

Every character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th) is L, U, or D.

Thus, S is easily playable.

Sample Input 2

DULL

Sample Output 2

No

The 3-rd character is not R, U, nor D, so S is not easily playable.

Sample Input 3

UUUUUUUUUUUUUUU

Sample Output 3

Yes

Sample Input 4

ULURU

Sample Output 4

No

Sample Input 5

RDULULDURURLRDULRLR

Sample Output 5

Yes



Sample input:
RUDLUDR


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""
check = 0
check2 = 0

for i in range(len(odd)):
  
  if odd[i] == "R" or odd[i] == "U" or odd[i] == "D":
    check += 1
  
  if check == len(odd):
    x1 = "Y"
  
for i in range(len(even)):
 
  if even[i] == "L" or even[i] == "U" or even[i] == "D":
    check2 += 1
 
  if check2 == len(even):
    x2 = "Y"
  
  
if x1 and x2 == "Y":
  xx = "Yes"
  
  
print(xx)

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""
check = 0
check2 = 0

for i in range(len(odd)):
  
  if odd[i] == "R" or odd[i] == "U" or odd[i] == "D":
    check += 1
  
  if check == len(odd):
    x1 = "Y"
  
for i in range(len(even)):
 
  if even[i] == "L" or "U" or "D":
    check2 += 1
 
  if check2 == len(even):
    x2 = "Y"
  
  
if x1 and x2 == "Y":
  xx = "Yes"
  
  
print(xx)

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
x = "No"

for i in range(len(odd)):
  if odd[i] == "L" or "U" or "D":
    x = "Yes"
  else:
    continue
  
for i in range(len(even)):
  if even[i] == "R" or "U" or "D":
    x = "Yes"
  else:
    continue
  
print(x)

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
x = "No"

for i in range(len(odd)):
  if odd[i] == "R" or "U" or "D":
    x = "Yes"
  else:
    continue
  
for i in range(len(even)):
  if even[i] == "L" or "U" or "D":
    x = "Yes"
  else:
    continue
  
print(x)

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
x = "No"

for i in range(len(odd)):
  if odd[i] == "R" or "U" or "D":
    x = "Yes"
  
for i in range(len(even)):
  if even[i] == "L" or "U" or "D":
    x = "Yes"
  
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S[1::2] == "R" or S[1::2] == "U" or S[1::2] == "D" :
  print("Yes")
  
else :
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
for i in range (len(s)//2):
    if s[2*i] == 'L' or s[2*i+1] == 'R' or s[-1] == 'L':
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution 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')

Submission status: Wrong Answer

Solution code:
S = list(input())
a = 0
if len(S)//2 == 0:
    for i in range(len(S)//2-1):
        if (S[2*i+1] == "L"or"U"or"D") and (S[2*i] == "R"or "U"or "D"):
            a = a+1
        else:
            a = a+0
else:
    for i in range(len(S)//2-1):
        if (S[2*i+1] == "L"or"U"or"D") and (S[2*i] == "R"or "U"or "D") and (S[-1] == "R"or "U"or "D"):
            a = a+1
        else:
            a = a+0


if a >= len(S)//2-1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
l = ['L', 'R', 'U', 'D']

ans='Yes' 
for i, s in enumerate(S):
  if i+1 % 2 == 0:
    if s not in ['L', 'U', 'D']:
      ans='No'
      break
  else:
    if s not in ['R', 'U', 'D']:
      ans='No'
      break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
l = ['L', 'R', 'U', 'D']

ans='Yes' 
for i, s in enumerate(S):
  if i+1 % 2 == 0:
    if s not in ['L', 'U', 'D']:
      ans='No'
      break
  elif i+1 % 2 != 0:
    if s not in ['R', 'U', 'D']:
      ans='No'
      break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
l = ['L', 'R', 'U', 'D']

ans='Yes' 
for i, s in enumerate(S):
  if i+1 % 2 == 0:
    if s not in ['L', 'U', 'D']:
      ans='No'
      break
  if i+1 % 2 != 0:
    if s not in ['R', 'U', 'D']:
      ans='No'
      break

print(ans)

Submission status: Wrong Answer

Solution 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
  elif i==len(s)-1:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
for i in range(len(S) // 2):
  if S[2*i] == "L" or S[2*i+1] == "R":
    print("No")
    break
else:
  print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

flg = 0

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

if flg == 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()

flg = 0

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

if flg == 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 == 0 and (s[i] != "L" and s[i] != "U" and s[i] != "D"):
        print("NO")
        break
    elif i % 2 == 1 and (s[i] != "R" and s[i] != "U" and s[i] != "D"):
        print("NO")
        break
    else:
        print("YES")
        break

Submission status: Wrong Answer

Solution code:
s = input()
i = 0
while True and i < len(s):
  # 奇数文字目
  if (i+1) % 2 == 1:
    if s[i] == "L":
      print("No")
      break
  # 偶数文字目
  if (i+1) % 2 == 0:
    if s[i] == "R":
      print("No")
      break
  if i == len(s)-1:
    print("yes")
  i += 1

Submission status: Wrong Answer

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

for i in range (n):
    if i % 2 == 1:
        if s[i] != "R":
            a=a+1
    if i % 2 == 0:
        if s[i] != "L":
            a=a+1
if a == len(s):
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

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

for i in range (n):
    if i % 2 == 1:
        if s[i] != "R":
            a=a+1
    if i % 2 == 0:
        if s[i] != "L":
            a=a+1
if a == len(s):
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

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

for i in range (n):
    if i % 2 == 0:
        if s[i] != "R":
            a=a+1
    if i % 2 == 1:
        if s[i] != "L":
            a=a+1
if a == len(s):
    print('Yes')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
N = input()

M = len(N)
flag = True

for i in range(M):
  if i % 2 == 0:
    if N[i] == "R":
      flag = False
  else:
    if N[i] == "L":
      flag = False
if flag == True:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
N = input()

M = int(len(N))//2
flag = True

for i in range(M):
  if N[i*2] == "R":
    flag = False
  elif N[i*2+1] == "L":
    flag = False
if flag == True:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

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

if num != 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

num = 0
for i in range(len(S)):
    print(i)
    if i % 2 == 0:
        if S[i] == "L":
            num += 1
    else:
        if i == "R":
            num += 1

if num != 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

num = 0
for i in S:
    num += 1
    if i != "L" or i != "R" or i != "U"or i !="D":
        print("No")
        break
    elif num % 2 != 0 and i == "L":
        print("No")
        break
    elif num % 2 == 0 and i == "R":
        print("No")
        break
    else:
        print("Yes")
        break

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import math
s=list(map(str,input()))
for i in range(math.ceil(len(s)/2)):
    if s[2*i]!='R':
        print('No')
        sys.exit()
for j in range(len(s)//2):
    if [2*i+1]!='L':
        print('No')
        sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
flg = True
for s in range(0,len(S)-1):
    if s%2 == 0 and S[s] == "L":
        flg = False
    elif s%2 != 0 and S[s] == "R":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
#list = S.split()
print(S)
flg = True
for s in range(0,len(S)-1):
    print(s)
    if s%2 == 0 and S[s] == "L":
        flg = False
    elif s%2 != 0 and S[s] == "R":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
#list = S.split()
print(S)
flg = True
for s in range(0,len(S)-1):
    print(s)
    if s%2 != 0 and S[s] == "R":
        flg = False
    elif S[s] == "L":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
ans = 'Yes'
for i in range(len(S) // 2):
  if S[2*i] == 'L' or S[2*i + 1] == 'R':
    ans = 'No'
    break

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

print("Yes" if ('R' not in S[0::2] and 'L' not in S[1::2]) else "No")

Submission status: Wrong Answer

Solution code:
import sys

s=str(input())

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

print ("yes" if count==1 else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
S.split()
for i in range(0,len(S)):
  if i%2==0:
    if S[i]=='L':
      print("No")
  if i%2!=0:
    if S[i]=='R':
      print("No")
  else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
li = list(input())

lik = li[1::2]
lig = li[0::2]
a = 0
b = 0
if 'L' in lik:
    a = a + 1

if 'R' in lig:
    b = b + 1

if a + b == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())
rtu = "Yes"
ks = 1
for i in S:
    if ks == 1:
        if i == "L":
            rtu = "No"
            ks = 0
            break
    elif ks == 0:
        if i == "R":
            rtu = "No"
            ks = 1
            break
print(rtu)

Submission status: Wrong Answer

Solution code:
ipt = str(input())
S = ipt.split()
rtu = "Yes"
ks = 1
for i in S:
    if ks == 1:
        if i == "L":
            rtu = "No"
            ks = 0
            break
    elif ks == 0:
        if i == "R":
            rtu = "No"
            ks = 1
            break
print(rtu)

Submission status: Wrong Answer

Solution code:
ipt = str(input())
S = ipt.split()
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ks += 1
print(rtu)

Submission status: Wrong Answer

Solution code:
ipt = str(input())
S = []
S = ipt.split()
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ka += 1
print(rtu)

Submission status: Wrong Answer

Solution code:
S = list(input())
t = 0
for i in range(len(S)):
  if {(i%2!=0 and S == ("R" or "U" or "D")) 
      or (i%2==0 and S == ("L" or "U" or "D"))}:
      t += 0
  else:
      t += 1
if t == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
t = 0
for i in range(len(S)):
  if {(i%2==0 and S == ("R" or "U" or "D")) 
      or (i%2!=0 and S == ("L" or "U" or "D"))}:
      t += 0
  else:
      t += 1
if t == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N = list(input())
N.insert(0, '')
even = N[2::2]
odd = N[1::2]
print(odd, even)
if ('R' in even or 'L' in odd):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(map(str, input()))
count = 0
while count+2 <= len(S):
    if S[count] == 'L':
        print('No')
        break
    elif S[count+1] == 'R':
        print('No')
        break
    else:
        count += 2
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
list_1=[w for w in input()]
result='Yes'
even_list=['L','U','D']
odd_list=['R','U','D']
for item in list_1[::2]:
  if item not in even_list:
    result='No'
    print (result)
    exit()
for item in list_1[1::2]:
  if item not in odd_list:
    result='No'
    print (result)
    exit()
print (result)

Submission status: Wrong Answer

Solution code:
s = input()
 
oddStep = ['R','U','D']
evenStep = ['L','U','D']
CNST_NO = 'No'
CNST_YES = 'Yes'
good_step = CNST_YES
 
for i in range( len( s )):
  if i % 2 == 0:
    if not ( s[ i ] in evenStep ):
      good_step = CNST_NO
  else:
    if not( s[ i ] in oddStep ):
      good_step = CNST_NO
  if good_step == CNST_NO:
    break
print( good_step )

Submission status: Wrong Answer

Solution code:
s = input()
 
oddStep = ['R','U','D']
evenStep = ['L','U','D']
CNST_NO = 'No'
CNST_YES = 'Yes'
good_step = CNST_NO
 
for i in range( len( s )):
  if i % 2 == 0:
    if s[ i ] in oddStep:
      good_step = CNST_YES
  else:
    if s[ i ] in evenStep:
      good_step = CNST_YES
  if good_step == CNST_YES:
    break
print( good_step )

Submission status: Wrong Answer

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

    odd = 1
    even = 1

    for i in range(1,len(s)):
        if i % 2 == 0:
            if s[i-1] == 'R':
                odd = 0
        else:
            if s[i-1] == 'L':
                even = 0

    if odd == 1 and even == 1:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()

    count = 0
    for s in S:
        if count == 0:
            count = 1
            if (s != "R") & (s != "U") & (s != "D"):
                return "No"
        else:
            count = 0
            if (s != "L") & (s != "U") & (s != "D"):
                return "No"
        return "Yes"
if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
A = list(input())
B=[]
C=[]

for i in range(1,len(A),2):
  B.append(A[i])
for i in range(0,len(A),2):
  C.append(A[i])
B=set(B)
C=set(C)

if {'D', 'U', 'L'} <= B and {'D', 'U', 'R'} <= C:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = readline().decode('utf8').rstrip()
flag1 = True
flag2 = True
Sodd = S[::2]
Seven = S[1::2]

if Sodd.count('L') != 0:
    Sodd = False
if Seven.count('R') != 0:
    Seven = False

print('Yes' if Sodd and Seven else 'No')

Submission status: Wrong Answer

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

for i in range(1, n):
    if i % 2 == 0:
        if not S[i-1] in even:
            ans = "No"
            break
        else:
            continue
    else:
        if not S[i-1] in odd:
            ans = "No"
            break
        else:
            continue

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
n = len(S)
ans = "Yes"

for i in range(1, n):
    if i % 2 == 0:
        if not any([S[i-1]=='L', S[i-1]=='U', S[i-1]=='D']):
            ans = "No"
            break
        else:
            continue
    else:
        if not any([S[i-1]=='R', S[i-1]=='U', S[i-1]=='D']):
            ans = "No"
            break
        else:
            continue

print(ans)

Submission status: Wrong Answer

Solution code:
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in range(len(s)):
  if s[i] == 'U' or s[i] == 'D':
    continue
  else:
    if i%2 == 0:
      if s[i] != 'L':
        print("No")
        exit()
    else:
      if s[i] != 'R':
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in range(len(s)):
  if i == 'U' or i == 'D':
    continue
  else:
    if i%2 == 0:
      if i != 'L':
        print("No")
        exit()
    else:
      if i != 'R':
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
k = ['R','U','D']
g = ['L','U','D']

s = input()
for i in range(len(s)):
  if i%2 == 0:
    if not i in g:
      print("No")
      exit()
  else:
    if not i in k:
      print("No")
      exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()

#odd loop
for i in S[0::2]:
    if i == 'L':
        print('NO')
        exit()
#even loop
for j in S[1::2]:
    if j == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()

#odd loop
for i in S[0:len(S)+1:2]:
    if i == 'L':
        print('NO')
        exit()

for j in S[1:len(S)+1:2]:
    if j == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()

for i in range(1, len(S), 2):
    if i == 'L':
        print('NO')
        exit()

for j in range(0, len(S), 2):
    if j == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()

#odd loop
for i in range(1, len(S), 2):
    if i == 'L':
        print('NO')
        exit()

#even loop
for j in range(0, len(S), 2):
    if j == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()
l = list(S)

#odd loop
for i in range(0,len(l), 2):
    if l[i] == 'L':
        print('NO')
        exit()

#even loop
for j in range(1, len(l), 2):
    if l[j] == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()
l = list(S)

#odd loop
for i in range(0,len(l),2):
    if l[i] == 'L':
        print('NO')
        exit()

#even loop
for j in range(1, len(l), 2):
    if l[j] == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()
l = list(S)

#odd loop
for i in range(0,len(S),2):
    if l[i] == 'L':
        print('NO')
        exit()

#even loop
for j in range(1, len(S), 2):
    if l[j] == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
S = input()
l = list(S)

#odd loop
for i in range(1, len(S), 2):
    if l[i] == 'L':
        print('NO')
        exit()

#even loop
for j in range(0, len(S), 2):
    if l[j] == 'R':
        print('NO')
        exit()

print('YES')

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
#print(n)
k,g=[],[]
for i in range(n):
    if i%2==0:
        k.append(s[i])
    else:
        g.append(s[i])
#print(k)
#print(g)
for j in k:
    if j == 'L':
        print('No')
        break

else:
    for l in g:
        if l == 'R':
            print('No')
            break
        else:
            print('Yes')
            break

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
#print(n)
k,g=[],[]
for i in range(n):
    if i%2==0:
        k.append(s[i])
    else:
        g.append(s[i])
#print(k)
#print(g)
for j in k:
    if j == 'L':
        print('No')
        break

else:
    for l in g:
        if l == 'R':
            print('No')
            break
        else:
            print('Yes')
            break

Submission status: Wrong Answer

Solution code:
S = input()
Odd = ['R', 'U', 'D']
Even = ['L', 'U', 'D']
print(S[1::2])

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

Submission status: Wrong Answer

Solution code:
S = input()
Odd = ['R', 'U', 'D']
Even = ['L', 'U', 'D']
print(S[1::2])

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

even = []
odd = []
for i, elem in enumerate(s):
  if i % 2 == 0:
    odd.append(elem)
  else:
    even.append(elem)

if list(set(even)) in ['D', 'U', 'L'] and list(set(odd)) in ['U', 'R', 'D']:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

def main():
    s = list(input())
    gusu_count = 0
    kisu_count = 0
    
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
                kisu_count += 1
                
        else:
            if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
                gusu_count += 1
                
    if gusu_count == len(s) // 2 and kisu_count == ((len(s) // 2 ) + 1):

        print('Yes')
    
    else:
        print('No')
    
    return 0
    
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()

OD = ["D", "R", "U"]
EV = ["D", "L", "U"]

if (sorted(set(s[::2])) == OD) and (sorted(set(s[1::2])) == EV):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
text = input()

if all(text[i * 2] != "L" for i in range(len(text) // 2)) and \
   all(text[i * 2 + 1] != "R" for i in range(len(text) // 2)):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()

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

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
li = list(S)
ans = "Yes"
for i in range(len(S)):
  if i % 2 == 0:
    if li[i] == "L":
      ans == "No"
      break
  else:
    if li[i] == "R":
      ans == "No"
      break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
ans = 0

for i in range(0, N, 2):
  if S[i] in odd is False:
    ans += 1
for i in range(1, N ,2):
  if S[i] in even is False:
    ans += 1
 
if ans == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import re


def main(s: str):
    if re.match(r'^([^L][^R])*[^L]$', s):
        print('Yes')
    else:
        print('No')


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

    main(s)

Submission status: Wrong Answer

Solution code:
def main(s: str):
    a = [s[i] for i in range(0, len(s) - 1, 2)]
    b = [s[i] for i in range(1, len(s) - 1, 2)]

    a.extend(['R', 'U', 'D'])
    b.extend(['L', 'U', 'D'])

    if set(a) - set(['R', 'U', 'D']) != set():
        print('No')
        return
    if set(b) - set(['L', 'U', 'D']) != set():
        print('No')
        return

    print('Yes')


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

    main(s)

Submission status: Wrong Answer

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

print('Yes')

Submission status: Wrong Answer

Solution code:
input_tap = input()
flag = 'No'

for i in range(0,len(input_tap)-2):
    if input_tap[i] == 'R' or input_tap[i] == 'L':
        if input_tap[i+1] == 'U':
            if input_tap[i+2] == 'D':
                flag = 'Yes'
print(flag)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s=input()
odev=0
for i in s:
	odev=odev+1
	if odev==1:
		if s=="L":
			print("No")
			break
	else:
		if s=="R":
			print("No")
			break
else:
	print("Yes")

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
print('No')

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
h = int(l/2)

if l % 2 ==0:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    print('Yes')

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

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
h = int(l/2)

if l % 2 ==0:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    print('Yes')

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

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
h = int(l/2)

if l % 2 ==0:
  for i in range(h-1):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    if s[l-1] == 'L':
      print('No')
    else:
      print('Yes')

else:
  for i in range(h):
    if s[2*i] == 'L' or s[2*i + 1] == 'R':
      print('No')
      break
  else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
from sys import stdin

char = stdin.readline().rstrip()

for i,c in enumerate(char):
    if i %2 ==0:
        if c not in ("R",'U','D'):
            print('no')
            break
    else:
        if c not in ("L",'U','D'):
            print('no')
            break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

can = True

for i in range(len(S)):
    if (i % 2 == 0):
        if (S[i] != 'R'):
            can = False
            break
    else:
        if (S[i] == 'L'):
            can = False
            break
if (can):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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