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: Accepted

Solution code:
s = input()
ans = "Yes"
for i, char in enumerate(s):
    if i % 2 == 1:
        if char == "R":
            ans = "No"
    else:
        if char == "L":
            ans = "No"

print(ans)

Submission status: Accepted

Solution code:
S = input()
lis = list(S)
count = 0

for i in range(len(lis)):
    if i % 2 == 0:
        if lis[i] == 'R':
            count += 1
    if i % 2 != 0:
        if lis[i] == 'L':
            count += 1

    if lis[i] == 'U' or lis[i] == 'D':
        count += 1

if count == len(lis):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

input_str = input()

ODD_STR = ['R','U','D']
EVEN_STR = ['L','U','D']
for index, st in enumerate(input_str):
    index += 1
    if index %2 == 0 and st in EVEN_STR:
        continue
    elif index%2 == 1 and st in ODD_STR:
        continue
    print('No')
    sys.exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
danceable = True
for i in range(len(S)):
    if i%2 == 0 and S[i] == 'L':
        print('No')
        danceable = False
        break
    if i%2 == 1 and S[i] == 'R':
        print('No')
        danceable = False
        break
if(danceable):
    print('Yes')

Submission status: Accepted

Solution code:
S = input()
ans = 'Yes'
for i, si in enumerate(S):
    if i % 2 == 0:
        if si == 'L':
            ans = 'No'
    else:
        if si == 'R':
            ans = 'No'


print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = 'Yes'
for i, si in enumerate(S):
    if (i + 1) % 2 == 1:
        if si not in ['R', 'U', 'D']:
            ans = 'No'
    else:
        if si not in ['L', 'U', 'D']:
            ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
result = "Yes"

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

Submission status: Accepted

Solution code:
A=input()
for i in A[::2]:
  if not i in ["R","U","D"]:
    print("No")
    exit()
for i in A[1::2]:
  if not i in ["L","U","D"]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
even_set = {S[i] for i in range(N) if i % 2 == 1}
odd_set = {S[i] for i in range(N) if i % 2 == 0}
even_Yes = {'L', 'U', 'D'}
odd_Yes = {'R', 'U', 'D'}
if even_set <= even_Yes and odd_set <= odd_Yes:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
step = input()

odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

f = True
for i in range(len(step)):
    if (i + 1) % 2 == 1 and step[i] not in odd:
        f = False
        break
    elif (i + 1) % 2 == 0 and step[i] not in even:
        f = False
        break
if f == False:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
#input
S = input()

isDance = True
for i, s in enumerate(S):
    if i % 2 != 0 and s == "R":
        isDance = False
    if i % 2 == 0 and s == "L":
        isDance = False

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

Submission status: Accepted

Solution code:
s = input()

for i, c in enumerate(s):
    if (i + 1) % 2 == 0:
        if not (c == 'L' or c == 'U' or c == 'D'):
            print('No')
            break
    elif (i + 1) % 2 != 0:
        if not (c == 'R' or c == 'U' or c == 'D'):
            print('No')
            break
else:
    print('Yes')

Submission status: Accepted

Solution code:
flag = True
for i, w in enumerate(input()):
    if i%2!=0:
        if w not in ['L','U','D']:
            flag = False
            break
    else:
        if w not in ['R','U','D']:
            flag = False
            break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

for i, ch in enumerate(s):
    if (i & 1) and ch == 'R':
        print("No")
        exit()
    if (not (i & 1)) and ch == 'L':
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
F = input()
o = {"R", "U","D"}
e = {"L", "U","D"}
flag = False
for i in range(len(F)):
    if( i+1) % 2 == 1:
        if F[i] not in o:
            print("No")
            flag = True
            break
    else:
        if F[i] not in e:
            print("No")
            flag = True
            break
if flag == False:
    print("Yes")

Submission status: Accepted

Solution code:
S = str(input())

X = []
ans = 0

for s in S:
    X.append(s)

X_even = X[1::2]
X_odd = X[::2]

for a in X_even:
    if a == 'L' or a == 'U' or a == 'D':
        pass
    else:
        ans += 1

for a in X_odd:
    if a == 'R' or a == 'U' or a == 'D':
        pass
    else:
        ans += 1
if ans >= 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = list(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')

Submission status: Accepted

Solution code:
from sys import stdin
tap = list(stdin.readline().rstrip())

for i, s in enumerate(tap, start=1):
  if i % 2 != 0:
    if s == "L":
      print("No")
      quit()
  else:
    if s == "R":
      print("No")
      quit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tap_list = list(input())
cnt = 0
for tap in tap_list:
    if cnt == 0:
        if tap == "L":
            cnt = 2
            break
        else:
            cnt = 1
    elif cnt == 1:
        if tap == "R":
            cnt = 2
            break
        else:
            cnt = 0

if cnt == 2:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = list(input())
a = True

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

Submission status: Accepted

Solution code:
s = list(map(str, input()))
a = 0
def judge(n):
    if n == 0:
        return 'Yes'
    else:
        return 'No'

for i, name in enumerate(s):
    if i % 2 == 0 and name == 'L':
        a += 1
    elif i % 2 == 1 and name == 'R':
        a += 1
    else:
        continue
print(judge(a))

Submission status: Accepted

Solution code:
import sys

s = input()
i = 0
while i < 100 and i < len(s):
    if s[i] != "R" and s[i] != "U" and s[i] != "D":
        print("No")
        sys.exit()
    i += 2
i = 1
while i < 100 and i < len(s):
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
        print("No")
        sys.exit()
    i += 2

print("Yes")

Submission status: Accepted

Solution code:
import re
s = str(input())
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = str(input())
i = 1
ans = 'Yes'
for x in S:
    if i % 2 == 1:
        if S[i-1] == 'L':
            ans = 'No'
            break
    else:
        if S[i-1] == 'R':
            ans = 'No'
            break
    i += 1
print(ans)

Submission status: Accepted

Solution code:
def solve():
    i = 1
    ans = 'Yes'
    for x in S:
        if i % 2 == 1:
            if S[i-1] == 'L':
                ans = 'No'
                break
        else:
            if S[i-1] == 'R':
                ans = 'No'
                break
        i += 1
    print(ans)

S = str(input())
solve()

Submission status: Accepted

Solution code:
s=input()

for i in range(len(s)):
	if s[i]=="U" or s[i]=="D":
		continue

	if (i%2==0 and s[i]!="R") or (i%2==1 and s[i]!="L"):
		print("No")
		exit()
print("Yes")

Submission status: Accepted

Solution code:
S = str(input())
SL = ["L", "U", "D"]
SR = ["R", "U", "D"]
for i in range(0, len(S)):
    if i & 1:
        if not(S[i] in SL):
            print("No")
            exit()
    else:
        if not(S[i] in SR):
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
s=list(input())
a=True

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

Submission status: Accepted

Solution code:
S = input()
A = True
for i in S[::2]:
  if i == "L":
    A = False   
for x in S[1::2]:
  if x == "R":
    A = False

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

Submission status: Accepted

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

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for idx, i in enumerate(s):
    if idx % 2 == 1 and i in ['L','U','D']:
        continue
    elif idx % 2 == 0 and i in ['R','U','D']:
        continue
    else:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()
res = "Yes"
for x in range(int(len(S)/2)+1):
  if 2*x < len(S):
    if S[2*x] not in ["R","U","D"]:
      res = "No"
  if 2*x + 1 < len(S):
    if S[2*x+1] not in ["L","U","D"]:
      res = "No"
print(res)

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.readline().rstrip()


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

print(ans)

Submission status: Accepted

Solution code:
s = list(input())
for i in range(len(s)):
  if i % 2 == 0:
    if not s[i] in "RUD":
      print ("No") 
      exit() 
  else: 
    if not s[i] in "LUD":
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()
even = True
res = True
for i in s:
    if(even and i in "RUD"):
        pass
    elif(not even and i in "LUD"):
        pass
    else:
        res = False
        break
    even = not even
    
if (res):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = [i.upper() for i in str(input())]

k = set('RUD')
g = set('LUD')


kk = set(s[::2])
gg = set(s[1::2])


if kk <= k and gg <= g:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import re
a = input()
b = re.compile('^([^L][^R])*[^L]?$')
if b.match(a):
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
tap_list = list(input())
confort = 0
for i in range(len(tap_list)):
  if (i+1) % 2 == 1 and tap_list[i] == "L":
    confort = 1
  elif (i+1) % 2 == 0 and tap_list[i] == "R":
    confort = 1

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

Submission status: Accepted

Solution code:
import re #与えられた条件にマッチする文字列か判定
a = input()
b = re.compile('^([^L][^R])*[^L]?$')
if b.match(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import re #与えられた条件にマッチする文字列か判定
a = input()
b = re.compile(r'^([^L][^R])*[^L]?$')
if b.match(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
cnt = 0
for i in S: 
    cnt += 1
    if cnt % 2 == 1 and i == 'L':
        print("No")
        break
    elif cnt % 2 == 0 and i == 'R':
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
c = True
for i in range(len(s)):
    if i % 2 == 1:
        if s[i] != 'U' and s[i] != 'D' and s[i] != 'L':
            c = False
    if i % 2 == 0:
        if s[i] != 'U' and s[i] != 'D' and s[i] != 'R':
            c = False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
total=0

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

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

Submission status: Accepted

Solution code:
S=input()
total=0

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

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

Submission status: Accepted

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


N = len(S)
X = 0

for i in range(N):
    if i % 2 == 0 and S[i] == "R" or S[i] == "U" or S[i] == "D":
        X += 1
    elif i % 2 == 1 and S[i] ==  "L" or S[i] == "U" or S[i] == "D":
        X += 1

if X == N:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import re

S = input()
A = re.compile(r'^([^L][^R])*[^L]?$')

if A.match(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
s_odd = s[::2]
s_even = s[1::2]
if s_odd.strip('RUD') or s_even.strip('LUD'):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S =input()
l =len(S)
letters=[]
for i in range(l):
  letters.append(S[i:i+1])
#print(letters)
indicater =0
#odd...R U D even...L U D
if l%2==0:
  for i in range(l//2):
    if (letters[2*i]=="R" or letters[2*i]=="U" or letters[2*i]=="D") and (letters[2*i+1]=="L" or letters[2*i+1]=="U" or letters[2*i+1]=="D"):
      indicater=indicater+0
    else:
      indicater=indicater+1
if l%2==1:
  for i in range((l+1)//2):
    if (letters[2*i]=="R" or letters[2*i]=="U" or letters[2*i]=="D"):
      indicater=indicater+0
    else:
      indicater=indicater+1
  for i in range((l-1)//2):
    if (letters[2*i+1]=="L" or letters[2*i+1]=="U" or letters[2*i+1]=="D"):
      indicater =indicater+0
    else:
      indicater =indicater+1
#print(indicater)
if indicater==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
line=input()

a=['R','U','D']
b=['L','U','D']
flag=True

for i in range(len(line)):
  if not flag:
    break
  if (i+1)%2==1:
    if line[i] not in a:
      flag=False
      print('No')
  else:
    if line[i] not in b:
      flag=False
      print('No')
if flag==True:
  print('Yes')

Submission status: Accepted

Solution code:
s=input()
s1=s[::2]
s2=s[1::2]
for i in s1:
    if i=='R' or i=='U' or i=='D':
        pass
    else:
        print("No")
        exit(0)
for i in s2:
    if i=='L' or i=='U' or i=='D':
        pass
    else:
        print("No")
        exit(0)
print("Yes")

Submission status: Accepted

Solution code:
S=input()

cnt=0
for i in range (0,len(S)):
    if i%2==0 :
        if S[i]!='L':
            cnt+=1
    else:
        if S[i]!='R':
            cnt+=1

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
S = input()
left_stp = [v in ["L","U","D"] for i, v in enumerate(S) if i % 2 == 1]
right_stp = [v in ["R","U","D"] for i, v in enumerate(S) if i % 2 == 0]
if all(left_stp) and all(right_stp):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

lst = []

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

Submission status: Accepted

Solution code:
s = input()

for i, c in enumerate(s):
    if i % 2 == 0:
        if c not in ["R", "U", "D"]:
            print("No")
            exit()
    else:
        if c not in ["L", "U", "D"]:
            print("No")
            exit()

print("Yes")

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
temp = True
for i in range(n):
    if (i+1) %2 == 1:
        if s[i] == "L":
            temp = False
            break
    else:
        if s[i] == "R":
            temp = False
            break
if temp:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
S = input()
count = 1
Flag = 0
for i in S:
    if count%2 == 1:
        if i == 'L':
            Flag = 1
    else:
        if i =='R':
            Flag  = 1
    count+=1
if Flag == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """RUDLUDR"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """DULL"""
        output = """No"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """UUUUUUUUUUUUUUU"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """ULURU"""
        output = """No"""
        self.assertIO(input, output)
    def test_入力例_5(self):
        input = """RDULULDURURLRDULRLR"""
        output = """Yes"""
        self.assertIO(input, output)
def resolve():
    LR=['RUD','LUD']
    s=input()
    for i in range(len(s)):
        if not(s[i] in LR[i%2]):
            print('No')
            break
    else:
        print("Yes")
if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
for num,letter in enumerate(S):
    num += 1
    if num % 2 == 1:
        if letter != "R" and letter != "U" and letter != "D":
            print("No")
            exit()
    else:
        if letter != "L" and letter != "U" and letter != "D":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
tap = input()

for i, j in enumerate(tap, start=1):
  if (i % 2 == 1 and j == "L") or (i % 2 == 0 and j == "R"):
    print("No")
    break
else:
  print("Yes")

Submission status: Accepted

Solution code:
s = input()

is_yes = True
for i in range(len(s)):
    if (i+1)%2 == 0 and s[i] == "R":
        is_yes = False
        break

    if (i+1)%2 == 1 and s[i] == "L":
        is_yes = False
        break

if is_yes is True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

s = input()
odd = ["R", "U", "D"]
even = ["L", "U", "D"]

for i in range(len(s)):
    if (i % 2 == 0 and s[i] not in odd) or (i % 2 == 1 and s[i] not in even):
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
S = list(input())

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

if a.count('L') == 0 and b.count('R') == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

S = input()
is_ok = True
for i, ch in enumerate(list(S)):
    if i % 2 == 0:
        if ch not in "RUD":
            is_ok = False
    else:
        if ch not in "LUD":
            is_ok = False

ans = "Yes" if is_ok else "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    s = input().strip()
    print(
        "Yes"
        if all([c in ("R", "U", "D") for c in s[::2]])
        and all([c in ("L", "U", "D") for c in s[1::2]])
        else "No"
    )


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S = input()
# 奇数文字目にLがあるとだめ
# 偶数文字目にRがあるとだめ
ng = ["L", "R"]
for i in range(0, len(S)):
  if S[i] == ng[i%2]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

for i, s in enumerate(S):
  if (i+1) % 2 != 0: # 奇数の場合
    if s not in odd:
      print('No')
      sys.exit()
  else:
    if s not in even:
      print('No')
      sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
S=input()
ans='Yes'

for i in range(0,int(len(S))):
  if i%2==0:
    if S[i]=='L':
        ans='No'
        break
  elif i%2==1:
    if S[i]=='R':
        ans='No'
        break
print(ans)

Submission status: Accepted

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
    print('No')
    break
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
odd = s[::2]
even = s[1::2]

flag1 = 1
for i in odd:
    if i not in ["R", "U", "D"]:
        flag1 = 0
flag2 = 1
for i in even:
    if i not in ["L", "U", "D"]:
        flag2 = 0
        
if flag1 == flag2 == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=list(input())

N=len(S)
ans='Yes'

for i in range(N):
  if i%2==0:
    if S[i]=='L':
      ans='No'
      break
  elif i%2==1:
    if S[i]=='R':
      ans='No'
      break
print(ans)

Submission status: Accepted

Solution code:
char=list(input())
cnt = 0
for i in range(len(char)):
    if ((i+1)%2==1 and char[i]=="R" )or ((i+1)%2==1 and char[i]=="U")or ((i+1)%2==1 and char[i]=="D"):
        cnt +=1
    elif (i%2==1 and char[i]=="L" )or (i%2==1 and char[i]=="U")or (i%2==1 and char[i]=="D"):
        cnt +=1
    else:
        cnt=0
        break

    

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

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    for i, c in enumerate(S):
        i += 1
        if i % 2 == 0:
            if c == 'R':
                return 'No'
        else:
            if c == 'L':
                return 'No'
    return 'Yes'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

S=input()
c=0
for i in range(len(S)):
    if i%2==0: #奇数、Lが踏みづらい
        if S[i]=="L":
            c+=1
    else: #偶数、Rが踏みづらい
        if S[i]=="R":
            c+=1
if c>0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

is_easy = True

for i in range(len(S)):
    if i % 2 == 0: # 奇数文字目
        if S[i] not in 'RUD':
            is_easy = False
    else:
        if S[i] not in 'LUD':
            is_easy = False

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

Submission status: Accepted

Solution code:
#coding: utf-8

S = list(input())
even = ['L','U','D']
odd = ['R','U','D']

ans_e, ans_o= [],[]

for i in range(1,len(S),2):
    if S[i] in even:
        ans_e.append(1)
    else:
        ans_e.append(0)

for i in range(0,len(S),2):
    if S[i] in odd:
        ans_o.append(1)
    else:
        ans_o.append(0)

if all(ans_o) and all(ans_e):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()

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

Submission status: Accepted

Solution code:
S = raw_input()

is_easy = True

for i in range(len(S)/2):
    if S[2*i] == "L":
        is_easy = False
    if S[2*i+1] == "R":
        is_easy = False

if len(S) == 1:
    if S[0] == "L":
        is_easy = False


if is_easy == False:
    print "No"
else:
    print "Yes"

Submission status: Accepted

Solution code:
s=input()
odd='RUD'
even='LUD'
count=0
for i in range(len(s)):
  if i%2==0:
    if s[i] in odd:
      count+=1
  else:
    if s[i] in even:
      count+=1
if count==len(s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
S=str(input())
lst1=['R','U','D']
lst2=['L','U','D']    
l=len(S)
if l%2==0:
  for i in range(0,l-1,2):
    if S[i] in lst1:
      pass
    else:
      print('No')
      sys.exit()
  for j in range(1,l,2):
    if S[j] in lst2:
      pass
    else:
      print('No')
      sys.exit()
  print('Yes')
else:
  for i in range(0,l,2):
    if S[i] in lst1:
      pass
    else:
      print('No')
      sys.exit()
  for j in range(1,l-1,2):
    if S[j] in lst2:
      pass
    else:
      print('No')
      sys.exit()
  print('Yes')

Submission status: Accepted

Solution code:
import copy
s=list(input())
a=copy.deepcopy(s)
b=copy.deepcopy(s)
a=a[0::2]
b=b[1::2]
resulta="L" in a
resultb="R" in b
if resulta == False and resultb == False:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = list(input())

odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

n = len(S)
check = True
for i in range(n):
    if i % 2 == 0:
        if S[i] not in odd:
            check = False
    else:
        if S[i] not in even:
            check = False

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

def main():
    S = input()
    print(is_easy(S))   

main()

Submission status: Accepted

Solution code:
s = input()

ans = "Yes"

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

print(ans)

Submission status: Accepted

Solution code:
Tap = input()
L_Tap = len(Tap)
 
Flag = 0
 
for i in range(L_Tap):
  if i % 2 == 0:
    if Tap[i] == 'R' or Tap[i] == 'U' or Tap[i] == 'D':
      Flag = 0
    else:
      Flag = 1
      break
  else:
    if Tap[i] == 'L' or Tap[i] == 'U' or Tap[i] == 'D':
      Flag = 0
    else:
      Flag = 1
      break
 
if Flag == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def receuve_input():
    input_string = str(input())
    return input_string

def judge_steppable(input_string):
    even_strings = [s for i,s in enumerate(input_string) if i % 2 == 1]
    odd_strings = [s for i,s in enumerate(input_string) if i % 2 == 0]

    if 'R' not in even_strings and 'L' not in odd_strings:
         print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    input_string = receuve_input()
    judge_steppable(input_string)