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().rstrip();
ans = 1;
for i in range(len(s)) :
	if i % 2 == 0 and s[i] == 'L' :
		ans = 0;
	if i % 2 == 1 and s[i] == 'R' :
		ans = 0;

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

Submission status: Accepted

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

S = input()
r = False
l = False
f = False
L = len(S)
for i in range(L):
    s = S[i]
    if s=='R':
        if (i+1)%2==0:
            f = True
            break
        r = True
    elif s=='L':
        if (i+1)%2==1:
            f = True
            break
        l = True
if f:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = list(input())

cnt = True

for i, si in enumerate(S):
    if i%2==0:
        if si=='L':
            cnt=False
            break
    else:
        if si=='R':
            cnt=False
            break
if cnt:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
S = input()
result = True
for i in range(len(S)):
    if (i + 1) % 2 == 1:
        if S[i] not in ['R','U','D']:
            result = False
            break
    else:
        if S[i] not in ['L','U','D']:
            result = False
            break
print('Yes' if result else 'No')

Submission status: Accepted

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

easy = True
for i, c in enumerate(s, 1):
    if i % 2 == 1 and c == 'L':
        easy = False
        break
    elif i % 2 == 0 and c == 'R':
        easy = False
        break

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

Submission status: Accepted

Solution code:
s=list(input())
ans="Yes"
i=0
while i!=len(s):
    if (i+1)%2==1:
        if s[i]=="L":
            ans="No"
    else:
        if s[i]=="R":
            ans="No"
    i+=1
print(ans)

Submission status: Accepted

Solution code:
s=input()
a=1
for i in s:
   if a%2==1:
       if i== "L":
           print("No")
           exit()
   if a%2==0:
       if i== "R":
           print("No")
           exit()
   a+=1
print("Yes")

Submission status: Accepted

Solution code:
A = str(input())
B = len(A)
C = list(A)
t = 0
for i in range(B):
    if i % 2 == 1:
        if C[i] == "L" or C[i] =="U" or C[i] =="D":
            t += 1
    else:
        if  C[i] == "R"or C[i] == "U" or C[i] =="D":
            t += 1
if t == B  :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
ok = True

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

Submission status: Accepted

Solution code:
a = input()
b = True
for i in range(len(a)):
    if i % 2 == 0:
        if a[i] == 'R' or a[i] == 'U' or a[i] == 'D':
            continue
        else:
            b = False
            break
    else:
        if a[i] == 'L' or a[i] == 'U' or a[i] == 'D':
            continue
        else:
            b = False
            break
if b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

for i, c in enumerate(S):
    if (i % 2 == 0 and c in 'RUD') or (i % 2 != 0 and c in 'LUD'):
        continue
    else:
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = True
for i in range(len(s)):
	if i % 2 == 0:
		if s[i] == 'L':
			flag = False
			break
	elif i % 2 == 1:
		if s[i] == 'R':
			flag = False
			break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

tf_list = []

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

if sum(tf_list) == 1 * len(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

Nodd = N[0::2]
Neven = N[1::2]

if "L" in Nodd or "R" in Neven:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s=list(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()
Flag = True
for i, ss in enumerate(S):
    if i % 2 == 0 and ss not in ['R', 'U', 'D']:
        Flag = False
        break
    if i % 2 != 0 and ss not in ['L', 'U', 'D']:
        Flag = False
        break

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

Submission status: Accepted

Solution code:
# coding: utf-8

line = input()
tester = ""
for i, word in enumerate(line):
    if (i + 1) % 2 == 0:
        if word == "R":
            tester = "No"
            break
    else:
        if word == "L":
            tester = "No"
            break
if tester == "":
    tester = "Yes"
print(tester)

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:
S = input()
length = len(S)
ans = "Yes"
for i in range(length):
    if (i % 2 == 0 and S[i] == "L")or(i % 2 == 1 and S[i] == "R"):
        ans = "No"
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=list(input())
s1=s[0::2]
s2=s[1::2]
flg=0

for i in s1:
    if i=="L":
        flg=1
for i in s2:
    if i=="R":
        flg=1
        
if flg==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

A = 'RUD'
B = 'LUD'

for s in S[0::2]:
    if s not in A:
        print('No')
        exit()

for s in S[1::2]:
    if s not in B:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    s_list = list(S)
    for i, s in enumerate(s_list):
        if i % 2 == 1:
            if s not in ['L', 'U', 'D']:
                print('No')
                return
        else:
            if s not in ['R', 'U', 'D']:
                print('No')
                return
    print('Yes')


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
len = len(S)
flag = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
length = len(s)

for i in range(length):
		ss = s[i]
		ii = i+1
		
		if ii%2 == 0:
			if ss != 'L' and ss != 'U' and ss != 'D':
					print("No")
					exit()
		else:
			if ss != 'R' and ss != 'U' and ss != 'D':	
					print("No")
					exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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"
    else:
        if S[i] == "R":
            ans = "No"

print(ans)

Submission status: Accepted

Solution code:
s = input()
e = "RUD"
o = "LUD"
f = True

for i in range(0, len(s)):
	if s[i] not in (e if (i + 1) % 2 == 1 else o):
		f = False
		break

print("Yes" if f == True else "No")

Submission status: Accepted

Solution code:
s = list(input())

bangou = 0
seikou = True
for moji in s:
    bangou += 1
    if bangou % 2 == 0:
        if moji in ["L", "U", "D"]:
            continue
        else:
            seikou = False
            break
    else:
        if moji in ["R", "U", "D"]:
            continue
        else:
            seikou = False
            break
if seikou:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0

for i in range(len(S)):
    if i % 2 == 0: #奇数
        if S[i] == "L":
            cnt += 1
    if i % 2 == 1:
        if S[i] == "R":
            cnt += 1

if cnt ==0:
    print('Yes')
if cnt !=0 :
    print("No")

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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

tmp1 = step[::2]
tmp2 = step[1::2]

if "L" in tmp1 or "R" in tmp2:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

res = True

for i, s in enumerate(S):
    if (i+1)%2 == 1:
        if s not in "RUD":
            res = False
            break
    else:
        if s not in "LUD":
            res = False
            break

print(("No", "Yes")[res])

Submission status: Accepted

Solution code:
S=input()

odd=S[::2]
even=S[1::2] if len(S) > 2 else []

a = 'L' in odd
b = 'R' in even

if a or b:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
a = list(str(input()))
n = len(a)
#b_list = list(map(int,input().split()))
#print(" ".join(map(str,c_list)))
count = 0
for i in range(0,n,2):
    if a[i] != "R" and  a[i] != "U" and a[i] != "D":
        count = 1
for i in range(1,n,2):
    if a[i] != "L" and  a[i] != "U" and a[i] != "D":
        count = 1
if count == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(x for x in input())
ans = 'Yes'
for i in range(1, len(s)+1):
  if i % 2 == 1:
    if s[i-1] == 'L':
      ans = 'No'
      break
  elif i % 2 == 0:
    if s[i-1] == 'R':
      ans = 'No'
      break
print(ans)

Submission status: Accepted

Solution code:
s = input()

flag = True

for i, x in enumerate(s):
    if x == "L":
        if i % 2 == 0:
            flag = False
            break
    elif x == "R":
        if i % 2 == 1:
            flag = False
            break

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

Submission status: Accepted

Solution code:
S=input()

flg=False
if len(set(S[::2]) - set(["R","D","U"])) == 0:
    if len(set(S[1:][::2]) - set(["L","U","D"])) ==0:
        flg=True

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
winFlag=True

for i,it in enumerate(s):
    if i%2==1:
        if not (it in "LUD") :
            winFlag=False
    else:
        if not (it in "RUD"):
            winFlag=False
if(winFlag==True):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
ans=1
for a,i in enumerate(s):
    if (a%2 and i=="R") or (a%2==0 and i=="L"):
        ans=0

print(["No","Yes"][ans])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
count = 1
num = 0
for i in S:
  if count %2 == 1:
    if i == "R" or i == "U" or i == "D":
      num += 1
  else:
    if i == "L" or i == "U" or i == "D":
      num += 1
  count += 1
if num == len(S):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

flg = 0

for i in range(len(s)):
    #偶数
    if i % 2 == 0:
        if s[i] == "L":
            flg = 1
    #奇数
    else:
        if s[i] == "R":
            flg = 1
            
if flg == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

flg = 0

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

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

Submission status: Accepted

Solution code:
S=input()
so=S[::2] # 奇数
se=S[1::2] # 偶数
if not("L" in so) and not("R" in se):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=input()
cnt=0
e=["L","U","D"]
o=["R","U","D"]
for i in range(len(a)):
  if i%2==0:
    if a[i] in o:
      pass
    else:
      cnt+=1
      break
  else:
    if a[i] in e:
      pass
    else:
      cnt+=1
      break

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
flag = True
for i in range(n):
    if i % 2 == 0:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            flag = False
    elif i % 2 == 1:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            continue
        else:
            flag = False

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

Submission status: Accepted

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

odd = set(s[::2])
even = set(s[1::2])

if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

odd = 0
even = 0
for i, s in enumerate(S):
    if (i+1)%2 == 0:
        if s == 'L' or s == 'U' or s == 'D':
            odd += 1
    else:
        if s == 'R' or s == 'U' or s == 'D':
            even += 1
            
if odd + even == len(S):
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        S = input().rstrip()
        odd = {'R', 'U', 'D'}
        even = {'L', 'U', 'D'}

        for i, c in enumerate(list(S)):
            if (i + 1) % 2 != 0:
                if c not in odd:
                    print('No')
                    exit()
            else:
                if c not in even:
                    print('No')
                    exit()
        print('Yes')


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    s = list(input())

    odd = set(s[0::2])
    even = set(s[1::2])

    if ("L" not in odd) and ("R" not in even):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt = 1
for i in S:
    if cnt%2 == 0:
        if i == "L" or i == "U" or i == "D":
            pass
        else:
            print("No")
            exit()
    else:
        if i == "R" or i == "U" or i == "D":
            pass
        else:
            print("No")
            exit()
    cnt += 1

print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = str(input())
ans = 'Yes'
for i, letter in enumerate(S):
  if i%2 == 0 and (letter == 'R' or letter == 'U' or letter == 'D'):
    continue
  elif i%2 == 1 and (letter == 'L' or letter == 'U' or letter == 'D'):
    continue
  else:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
s = input()
flag = True
for i, e in enumerate(s):
  if i%2==0 and e not in "RUD":
    flag = False
  elif i%2==1 and e not in "LUD":
    flag = False
if flag:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
odd = ["R", "U", "D"]
even = ["L", "U", "D"]
i = 0
ans = "Yes"

for s in S:
    if i % 2 == 0:
        if s not in odd:
            ans = "No"
            break
    else:
        if s not in even:
            ans = "No"
            break
    i += 1

print(ans)

Submission status: Accepted

Solution code:
from itertools import cycle

o = cycle(['RUD', 'LUD'])
i = input()
u = []
for x, y in zip(o, i):
    if y in x:
        u.append(True)
    else:
        u.append(False)

print('Yes' if all(u) else 'No')

Submission status: Accepted

Solution code:
#  --*-coding:utf-8-*--

def f(S):
    for i, c in enumerate(S):
        if i%2 == 0:
            if c == 'L':
                return False
        elif c == 'R':
            return False
            
    return True


def main():
    S = input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ls=list(input())

flag="Yes"
for i,step in enumerate(ls):
    idx=i+1
    if idx%2==1:
        if step=="L":
            flag="No"
            break
    else:
        if step=="R":
            flag="No"
            break
print(flag)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
N = input()

if 'L' in N[0::2]:
    print('No')    
elif 'R' in N[1::2]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

for i,value in enumerate(S):
    if i % 2 == 0:
        if value == 'L':
            print('No')
            exit()
    else:
        if value == 'R':
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    ss = input()
    odd = ["R","U","D"]
    even = ["L","U","D"]
    for s in ss[::2]:
        if not s in odd:
            return False
    for s in ss[1::2]:
        if not s in even:
            return False
    return True

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

Submission status: Accepted

Solution code:
s=input()
print('YNeos'[not (all(x in ['L','U','D'] for x in s[1::2]) and all(x in ['R','U','D'] for x in s[::2]))::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8

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

    for idx, str_ in enumerate(S):
        if idx % 2 != 0:
            if str_ in ["L", "U", "D"]:
                continue
            else:
                print("No")
                break
        else:
            if str_ in ["R", "U", "D"]:
                continue
            else:
                print("No")
                break
    else:
        print("Yes")

Submission status: Accepted

Solution code:
S=list(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:
            count=0
            break
    else:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            count=1
        else:
            count=0
            break
if count==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def f_b():
    s = input()
    e, o, a = "RUD", "LUD", "Yes"
    for i, si in enumerate(s):
        if i%2==0:
            if si not in e:
                a = "No"
                break
        elif i%2==1:
            if si not in o:
                a = "No"
                break

    print(a)

if __name__ == "__main__":
    f_b()

Submission status: Accepted

Solution code:
s = input()

for i, v in enumerate(s):
    if i % 2 == 1:
        if not v in 'LUD':
            print('No')
            break
    else:
        if not v in 'RUD':
            print('No')
            break
else:
    print('Yes')

Submission status: Accepted

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

for i in range(len(s)):
    if i%2 == 1:
        if s[i] == 'R':
            ans = 'No'
            break
    else:
        if s[i] == 'L':
            ans = 'No'
            break

print(ans)

Submission status: Accepted

Solution code:
S = input()

isEasy = True

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

Submission status: Accepted

Solution code:
S = input()

odd_S = list(S)[::2]
even_S = list(S)[1::2]

if 'L' in odd_S or 'R' in even_S :
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

i = 1
flag = True
for s in S:
    if i % 2 == 1 and (s == 'R' or s == 'U' or s == 'D'):
        i += 1
        continue
    elif i % 2 == 0 and (s == 'L' or s == 'U' or s == 'D'):
        i+= 1
    else:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#N = int(input())
#S = input()
S = list(input())

#N,K=map(int,input().split())
#S=list(map(int,input().split()))


ans='Yes'

for i,s in enumerate(S):
    
    if i%2==0: #guusuu mojiretu
        if s=='L':
            ans='No'
    else:
        if s=='R':
            ans='No'





print(str(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for i in range(1,len(s)+1):
    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: Accepted

Solution code:
#B
s=input()
t=0
for i in range(len(s)):
    if i%2==0:
        if s[i]=="L":
            t=10
            break
    else:
        if s[i]=="R":
            t=10
            break
if t==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()

flag=1

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

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

Submission status: Accepted

Solution code:
import sys
def main():
    S = input()
    for i in range(len(S)):
        if i % 2 != 0:
            if S[i] == "L" or S[i] == "U" or S[i] == "D":
                continue
            else:
                print("No")
                exit()
        else:
            if S[i] == "R" or S[i] == "U" or S[i] == "D":
                continue
            else:
                print("No")
                exit()
    print("Yes")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

i = 0
ans = 'Yes'
for x in S:
    if i == 0:
        if x not in ['R','U','D']:
            ans = 'No'
            break
        i += 1
    else:
        if x not in ['L','U','D']:
            ans = 'No'
            break
        i -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

Solution code:
import sys

s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = True

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

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

Submission status: Accepted

Solution code:
import sys
S=list(input())

for i in S[::2]:
	if not(i=="R" or i=="U" or i=="D"):
		print("No")
		sys.exit()

for i in S[1::2]:
	if not(i=="L" or i=="U" or i=="D"):
		print("No")
		sys.exit()
	
print("Yes")

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()
Flag=True

for i in S[1:100:2]:
  if i=="L" or i=="U" or i=="D":
    pass
  else:
    Flag=False
    
for j in S[0:100:2]:
  if j=="R" or j=="U" or j=="D":
    pass
  else:
    Flag=False

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