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:
def main():
    s = input()
    for i in range(len(s)):
        if (i+1) % 2 == 1:
            if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
                pass
            else:
                print('No')
                break
        else:
            if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
                pass
            else:
                print('No')
                break
    else:
        print('Yes')

    return 0;

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

s = input().strip()

for i, c in enumerate(s):
    if i % 2 == 0:
        if c == "L":
            print("No")
            sys.exit()
    else:
        if c == "R":
            print("No")
            sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
s = input()

num = 0
kisu = {'R', 'U', 'D'}
guusu = {'L', 'U', 'D'}
result = True
for i in s:
    num += 1
    if ((num % 2) == 1) and (i in kisu):
        continue
    elif ((num % 2) == 0) and (i in guusu):
        continue
    else:
        result = False

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

Submission status: Accepted

Solution code:
S = input()

even_success = True
odd_success = True
for i in range(len(S)):
    c = S[i]
    # 偶数番目チェック
    if i % 2 != 0:
        # print('even')
        if c not in ['L', 'U', 'D']:
            # print('even failed', c)
            even_success = False
    else:
        # print('odd')
        if c not in ['R', 'U', 'D']:        
        
            # print('odd failed', c)
            odd_success = False

if even_success and odd_success:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


o_moji = set(['R', 'U', 'D'])
e_moji = set(['L', 'U', 'D'])


if len(S) == 1:
    if S in o_moji:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

odd = S[::2]
even = S[1::2]


for n in odd:
    if n in o_moji:
        continue
    else:
        print('No')
        exit()


for n in even:
    if n in e_moji:
        continue
    else:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
def main():
  steps = raw_input()
  easy = True
  for i, c in enumerate(steps):
    if (i+1) % 2 == 0:
      if c not in ['L', 'U', 'D']:
        easy = False
        break
    else:
      if c not in ['R', 'U', 'D']:
        easy = False
        break
  print("Yes" if easy else "No")

main()

Submission status: Accepted

Solution code:
import sys
# a, b = map(int,input().split())

# n,k = map(int,input().split())
# n = int(input())
# b_l = list(map(int,input().split()))
S = input()

for i,s in enumerate(S):
        ix = i+1
        if (ix % 2) != 0:
                if s == 'L':
                        print('No')
                        sys.exit()
        else:
                if s == 'R':
                        print('No')
                        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
steps = input()

odd_steps = [x for i, x in enumerate(steps) if i % 2 == 0]
even_steps = [x for i, x in enumerate(steps) if i % 2 == 1]

if "L" in odd_steps or "R" in even_steps:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

p = 0

for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == 'L':
      p += 1
  elif i % 2 == 1:
    if S[i] == 'R':
      p += 1
  if p == 1:
    break
      
if p != 0:
  print('No')
elif p == 0:
  print('Yes')

Submission status: Accepted

Solution code:
a = list(input())
flag = True
for i in range(len(a)):
    if i % 2 == 1:
        if a[i] == 'L' or a[i] == 'U' or a[i] == 'D':
            pass
        else:
            flag = False
    else:
        if a[i] == 'R' or a[i] == 'U' or a[i] == 'D':
            pass
        else:
            flag = False

if flag:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 9)


def main():
    S = INPUT()

    parity = True
    for s in S:
        if parity:
            if s == 'L':
                print('No')
                sys.exit()
            parity = False
        else:
            if s == 'R':
                print('No')
                sys.exit()
            parity = True

    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
dance = str(input())
if dance[0::2].count("L") == 0 and dance[1::2].count("R") == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys

S = input()

for i in range(len(S)):
  if i % 2 == 0:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      print('No')
      sys.exit()
  else:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      print('No')
      sys.exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ok=1
for i in range(0,len(s),2):
    if s[i] not in 'RUD':
        ok = 0
for i in range(1,len(s),2):
    if s[i] not in 'LUD':
        ok = 0
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

s1 = set(s[::2])
s2 = set(s[1::2])

print("Yes" if ({'R', 'U', 'D'} | s1 == {'R', 'U', 'D'} and {'D', 'L', 'U'} | s2 == {'D', 'L', 'U'}) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

evenS=[]
oddS=[]

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

if('R' in evenS) or ('L' in oddS):
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

S = input()

evenNumber = ["D", "R", "U"]
oddNumber = ["L", "U", "D"]

for i, x in enumerate(S):
    if i%2 == 0:
        if x in evenNumber:
            continue

        else:
            print("No")
            sys.exit()

    else:
        if i%2 == 1:
            if x in oddNumber:
                continue

            else:
                print("No")
                sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
import sys
S = input()

tmp = 0

for i in range(len(S)):
    if((i+1)%2 == 1 and S[i]=='L'):
        print('No')
        tmp +=1
        sys.exit()
        
    if((i+1)%2 == 0 and S[i]=='R'):
        print('No')
        tmp +=1
        sys.exit

if(tmp ==0):
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

kisuu = set(S[::2])
guusuu = set(S[1::2])

if 'L' in kisuu or 'R' in guusuu:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
n=1

for i in s:
    if n%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()
    n+=1

print("Yes")

Submission status: Accepted

Solution code:
a=input()
lista=list(a)
j=1
listodd=['R','U','D']
listeven=['L','U','D']

for i in lista:
    if j%2==1:
        if i not in listodd:
            print('No')
            break
    elif j%2==0:
        if i not in listeven:
            print('No')
            break
    j=j+1
if j==len(lista)+1:
    print('Yes')

Submission status: Accepted

Solution code:
s = list(input())

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

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

Submission status: Accepted

Solution code:
S = input()

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

print("Yes")

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()
flag = 1
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] != "R" and S[i] != "U" and S[i] != "D":
            flag = 0
    elif i % 2 == 1:
        if S[i] != "L" and S[i] != "U" and S[i] != "D":
            flag = 0

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

Submission status: Accepted

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

flag = False

for idx, char in enumerate(S):
    if idx%2 == 0:
        if char in even:
            pass
        else:
            flag = True
            break
    else:
        if char in odd:
            pass
        else:
            flag = True
            break
        
if flag:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

Judge = True
for i,s in enumerate(S):

    if i == 0:
        if s == "R" or s == "U" or s == "D":
            continue
        else:
            Judge = False
            # print(i)
            break

    elif i % 2 == 0:
        if s == "R" or s == "U" or s == "D":
            continue
        else:
            Judge = False
            # print(i)
            break

    else:
        if s == "L" or s == "U" or s == "D":
            continue
        else:
            Judge = False
            # print(i)
            break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

ans = 'Yes'

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

print('Yes')

Submission status: Accepted

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

  print("Yes")

Submission status: Accepted

Solution code:
S = input()
ans = "Yes"
for i, s in enumerate(S):
    if i % 2 == 0: # iは0から
        if s == "L":
            ans = "No"
            break
    else:
        if s == "R":
            ans = "No"
            break

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
str_list  = stdin.readline().rstrip()


kisu = ['R','U','D']
gusu = ['L','U','D']


for i in range(len(str_list)):
    # 0から始まるので奇数なら偶数の配列を確かめる
    if i % 2 == 0:
        if str_list[i] in kisu:
            pass
        else:
            ans='No'
            break

    else:
        if str_list[i] in gusu:
            pass
        else:
            ans='No'
            break
else:
    ans='Yes'

print(ans)

Submission status: Accepted

Solution code:
import sys

S = input()

for i, letter in enumerate(list(S)):
    if letter == 'U' or letter == 'D':
        continue
    
    if ((i+1) % 2 == 0 and letter == 'R') or ((i+1) % 2 == 1 and letter == 'L'):
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

for i in range(1,len(S)+1):
    if i % 2 == 1 and S[i-1] not in 'RUD':
        print('No')
        break
    if i % 2 == 0 and S[i-1] not in 'LUD':
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys

mys = input()

list1 = ['R', 'U', 'D']
list2 = ['L', 'U', 'D']


mycnt = 1
 
for i in mys:
    if mycnt%2 != 0:
        if i not in list1:
            print('No')
            sys.exit()
    
    else:
        if i not in list2:
            print('No')
            sys.exit()
            
    mycnt += 1

print('Yes')

Submission status: Accepted

Solution code:
S = input()
N = len(S)

ans = 'Yes'
for n in range(N):
    if n%2==0 and S[n]=='L':
        ans = 'No'
    if n%2==1 and S[n]=='R':
        ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

    else:
        if S[i] == "L":
            print("No")
            break

    if i == len(S) - 1:
        print("Yes")

Submission status: Accepted

Solution code:
a = input()
n = len(a)
flag = True
for i in range(1,n+1):
    if i%2 == 0 and (a[i-1]=='L' or a[i-1]=='U' or a[i-1]=='D'):
        pass
    elif i%2 == 1 and (a[i-1]=='R' or a[i-1]=='U' or a[i-1]=='D'):
        pass
    else:
        flag = False
        break
if flag == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    S = input()
    count = 1
    ans = 0

    for s in S:
        if count % 2 == 1:
            if s == "R" or s == "U" or s == "D":
                ans += 1
        else:
            if s == "L" or s == "U" or s == "D":
                ans += 1
        count += 1

    if len(S) == ans:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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


def solve(S: str):
    flag = True
    strings_odd = ['R', 'U', 'D']
    strings_even = ['L', 'U', 'D']
    for i, s in enumerate(S):
        i = i + 1
        if i % 2 == 0:
            if s in strings_even:
                pass
            else:
                flag = False
        if i % 2 == 1:
            if s in strings_odd:
                pass
            else:
                flag = False
    if flag == True:
        print('Yes')
    else:
        print('No')
    return


# 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()
cond=0
for j in range(len(S)):
  if (j+1)%2==1 and S[j]=='L':
    cond=1
    break
  elif (j+1)%2==0 and S[j]=='R':
    cond=1
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
So = [S[i] for i in range(0, len(S), 2)]
Se = [S[i] for i in range(1, len(S), 2)]
anso = True
anse = True
for s in So:
    if s=="R" or s=="U" or s=="D":
        anso = True
    else:
        anso = False
        break
for s in Se:
    if s=="L" or s=="U" or s=="D":
        anse = True
    else:
        anse = False
        break
if anso and anse:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import  sys

t = input()

for i in range(len(t)):
    if i % 2 == 0:
        if t[i] == "R" or t[i] == "U" or t[i] == "D":
            continue
        else:
            print("No")
            sys.exit()
    else:
        if  t[i] == "L" or t[i] == "U" or t[i] == "D":
            continue
        else:
            print("No")
            sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()

odd_yes = True
for i in range(0, len(S), 2):
    if not S[i] in "RUD":
        odd_yes = False
        break

even_yes = True
for i in range(1, len(S), 2):
    if not S[i] in "LUD":
        even_yes = False
        break

if odd_yes and even_yes:
    print("Yes")
else:
    print("No")

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:
S = input()
for i, s in enumerate(S):
    if i % 2 == 1:
        if s not in "LUD":
            print("No")
            quit()
    else:
        if s not in "RUD":
            print("No")
            quit()
print("Yes")

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
  if i%2:
    if s[i]!="L" and s[i]!="U" and s[i]!="D":
      print("No")
      exit()
  else:
    if s[i]!="R" and s[i]!="U" and s[i]!="D":
      print("No")
      exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

judgeodd = True
judgeeven = True

for i,s in enumerate(S):
    if (i + 1) % 2 == 0:
        if s == "R":
            judgeeven = False
    else:
        if s == "L":
            judgeodd = False

if judgeeven and judgeodd:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    odd_move = ['R', 'U', 'D']
    even_move = ['L', 'U', 'D']

    move_list = [
        odd_move, even_move
    ]

    s = input()
    count = 0
    flag = True
    for c in s:
        if not (c in move_list[count]):
            flag = False
            break
        count = (count+1) % 2

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(str, input().split()))[0]
fumi = {0:["R","U","D"], 1:["L","U","D"]}
is_yasui = True
for i in range(len(s)):
    if s[i] not in fumi[i%2]:
        is_yasui = False
        break
        
if is_yasui:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

flg = True
for i in range(len(s)):
    if i % 2 != 0:
        if not s[i] in even:
            flg = False
            break
    else:
        if not s[i] in odd:
            flg = False
            break
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()
cnt=0

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

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

Submission status: Accepted

Solution code:
s = list(input())

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():
    input = lambda: stdin.readline()[:-1]
    S = input()

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

is_odd = True
is_even = True

for i in range(len(S)):
    if (i+1) % 2 == 1:
        if S[i] == 'L':
            is_odd = False
    else:
        if S[i] == 'R':
            is_even = False

print('Yes' if is_odd and is_even else 'No')

Submission status: Accepted

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

    f = True
    for i in range(len(S)):
        if i % 2 == 1:
            if S[i] == "R":
                f = False
        else:
            if S[i] == "L":
                f = False

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


if __name__ == '__main__':
    p_b()

Submission status: Accepted

Solution code:
s=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()
  if(i%2 == 1):
    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=list(input())
n = len(S)

for ii in range(1,n+1):
    if ii % 2 != 0 and S[ii-1] == "L":
        print("No")
        break
    elif ii % 2 == 0 and S[ii-1] == "R":
        print("No")
        break
    if ii == n:
        print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

S = list(sys.stdin.readline().rstrip())
ans = 'Yes'

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

odd = s[0::2]
even = s[1::2]

flag=0
for i in list(set(odd)):
    if i not in ["R", "U", "D"]:
        flag=1

for i in list(set(even)):
    if i not in ["L", "U", "D"]:
        flag=1
if flag==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S  = list(input())
index_even = ['R','U','D']
index_odd = ['L','U','D']
cnt_odd = 0
cnt_even = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] in index_even:
            cnt_even += 1
    else:
        if S[i] in index_odd:
            cnt_odd += 1
if (cnt_even + cnt_odd) == len(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def is_easy_steps(steps):
    if 'L' in steps[::2]:
        return "No"
    if 'R' in steps[1::2]:
        return "No"
    return "Yes"
print(is_easy_steps(input()))

Submission status: Accepted

Solution code:
S = input()

result = 0
for i in range(len(S)):
    if(i%2 == 0):
        if(S[i] == "L"):
            result = 1
            break
    elif(i%2 == 1):
        if(S[i] == "R"):
            result = 1
            break


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

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
easy_list = ['RUD','LUD']
S = input()
N = len(S)
for i in range(N):
    s = S[i]
    if s not in easy_list[i%2]:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
DANCE = ['L', 'R', 'U', 'D']
EVEN_GOOD = ['L', 'U', 'D']
ODD_GOOD = ['R', 'U', 'D']

even = list()
odd = list()

S = input()
S = list(S)

for i, s in enumerate(S):
    if (i+1) % 2 == 0:
        even.append(s)
    else:
        odd.append(s)

flag = True

for e in even:
    if e in EVEN_GOOD:
        pass
    else:
        flag = False

for o in odd:
    if o in ODD_GOOD:
        pass
    else:
        flag = False

if flag:
    print('Yes', end='')
else:
    print('No', end='')

Submission status: Accepted

Solution code:
s = input()

s_list = list(s)
ans = 'Yes'

for i in range(len(s_list)):
    if i % 2 != 0:
        if s_list[i] == 'R':
            ans = 'No'
            break
    else:
        if s_list[i] == 'L':
            ans = 'No'
            break
print(ans)