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()
flag = True
for ss in s[::2]:
    if ss not in ["R", "U", "D"]:
        flag = False

for ss in s[1::2]:
    if ss not in ["L", "U", "D"]:
        flag = False

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

S = np.array(list(sys.stdin.readline().rstrip()))
a = np.any(S[::2] == 'L') or np.any(S[1::2] == 'R')
if not a:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    s=input()
    ans="Yes"
    for i,c in enumerate(s):
        if i%2:
            if c=="R":
                ans="No"
                break
        else:
            if c=="L":
                ans="No"
                break
    print(ans)
main()

Submission status: Accepted

Solution code:
def getlist():
	return list(map(int, input().split()))

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

print(judge)

Submission status: Accepted

Solution code:
s = input()


flag = True
for i in range(len(s)):
    if (i+1) %2 == 0:
        if s[i] in ["L","U","D"]:
            continue
        else:
            flag = False
            break
    else:
        if s[i] in ["R","U","D"]:
            continue
        else:
            flag = False
            break

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
s = raw_input()
easy = True
#odd RUD
#even LUD
for i in xrange(len(s)):
  if s[i] == 'R' and (i+1)%2 == 0:
    easy = False
  elif s[i] == 'L' and (i+1)%2 == 1:
    easy = False
if easy:
  print 'Yes'
else:
  print 'No'

Submission status: Accepted

Solution code:
S = input()
for i in range(len(S)):
    if (i + 1) % 2 == 1 and (S[i] == 'R' or S[i] == 'U' or S[i] == 'D'):
        continue
    elif (i + 1) % 2 == 0 and (S[i] == 'L' or S[i] == 'U' or S[i] == 'D'):
        continue
    print("No")
    break
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' or s[i]=='U' or s[i]=='D':
            continue
        else:
            ans='No'
    else:
        if s[i]=='R' or s[i]=='U' or s[i]=='D':
            continue
        else:
            ans='No'
print(ans)

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 == 0:
        if s[i] in {'R','U','D'}:
            continue
        else:
            print('No')
            exit()
    if i% 2 != 0:
        if s[i] in {'L','U','D'}:
            continue
        else:
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
for i in range(len(S)):
    s = S[i]

    if (i+1)%2 == 0:
        if s=='R':
            ans = 'No'
            break
    else:
        if s=='L':
            ans = 'No'
            break
print(ans)

Submission status: Accepted

Solution code:
Ss = input()

S1s = Ss[::2]
S2s = Ss[1::2]

if 'L' not in S1s and 'R' not in S2s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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()
    elif s[i] == 'R':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
kisu=['R', 'U', 'D']
gusu=['L', 'U', 'D']

s=input()
swit=0
for i in range(len(s)):
    if i%2==0:
        if not(s[i] in kisu):
            swit=1
    else:
        if not(s[i] in gusu):
            swit=1

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

Submission status: Accepted

Solution code:
s = input()
ok = 1
for i, c in enumerate(s):
  if i%2:
    if c=='R': ok = 0
  else:
    if c=='L': ok = 0
print(['No','Yes'][ok])

Submission status: Accepted

Solution code:
S=input()
ans = True
for i,s in enumerate(S,1):
    if (i%2)==1 and s=="L":ans = False
    if (i%2)==0 and s=="R":ans = False
print("Yes" if ans else "No")

Submission status: Accepted

Solution code:
S = input()

for i, s in enumerate(S):
    if i%2==0:
        if s=='R' or s=='U' or s=='D':
            pass
        else:
            print('No')
            exit()
    else:
        if s=='L' or s=='U' or s=='D':
            pass
        else:
            print('No')
            exit()
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n):
  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:
def main():
    S = input()
    ok = True
    for c in S[::2]:
        if c == "L":
            ok = False
    for c in S[1::2]:
        if c == "R":
            ok = False
    if ok:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
lst = ['R','U','D']
lst2 = ['L','U','D']
for i in range(n):
    if i % 2 == 0:
        if s[i] in lst:
            continue
        else:
            print('No')
            quit()
    else:
        if s[i] in lst2:
            continue
        else:
            print('No')
            quit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
from heapq import heappop, heappush
from operator import itemgetter
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10**9 + 7
INF = float('inf')

def sol():
    S = input().rstrip()

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


sol()

Submission status: Accepted

Solution code:
s=input()

for i,c in enumerate(s):
  if i % 2 == 0 and c == 'L':
    print('No')
    break
  elif i % 2 and c == 'R':
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

Solution code:


S = list(input())
N = len(S)
flag = True
for i in range(N):
    if i%2 == 0 and S[i] == 'L':
        flag = False
        break
    elif i%2 == 1 and S[i] == 'R':
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

for i, s in enumerate(S):
    if i % 2:
        if s == "R":
            print("No")
            exit()
    else:
        if s == "L":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()

if 'L' in s[::2] or 'R' in s[1::2]:
    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] == "L":
            print("No")
            exit()
    else:
        if s[i] == "R":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

S=input().strip()
LEN=len(S)

flag=1

for i in range(LEN):
    if i%2==1:
        if S[i]=="R":
            flag=0

    else:
        if S[i]=="L":
            flag=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(S: str):
    if "L" in S[0::2]:
        no()
        return
    elif "R" in S[1::2]:
        no()
        return
    yes()
    return


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()

if any(c=='L' for c in S[::2]):
    print('No')
    exit()
if any(c=='R' for c in S[1::2]):
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

A=[["R","U","D"],["L","U","D"]]

ans = 0
t = 0
for i in range(len(s)):
    if s[i] in A[t]:
        ans += 1
    t = (t+1) % 2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy

def j(n):
    if n:print("Yes")
    else:print("No")
    exit(0)
rem = 10 ** 9 + 7

"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def ipmultiplerow(n):
    a = []
    for i in range(n):
        a.append(ip())
    return a
def printrow(a):
    for i in a:
        print(i)
a = input()
for i in range(len(a)):
    if i%2:
        if a[i] == "R":j(0)
    else:
        if a[i] == "L":j(0)
j(1)

Submission status: Accepted

Solution code:
S = input()

flag = True
for i, s in enumerate(S):
    if i % 2 == 0:
        if s in ["R", "U", "D"]:
            continue
        else:
            flag = False
    else:
        if s in ["L", "U", "D"]:
            continue
        else:
            flag = False


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

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()
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:
S = input()
flag = True
for s in S[::2]:
    if(s == 'L'):
        flag = False
        break
for s in S[1::2]:
    if(s == 'R'):
        flag = False
        break
if(flag):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
ans = True
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == 'L':
            ans = False
    else:
        if s[i] == 'R':
            ans = False
print(['No', 'Yes'][ans])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    s = input().strip()

    ok = True
    for i in range(len(s)):
        if i&1:
            if s[i] == "R":
                ok = False
                break
        else:
            if s[i] == "L":
                ok = False
                break
    
    if ok:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
b = list(input())
if all(i in ["R", "U", "D"] for i in b[::2]) and all(i in ["L", "U","D"] for i in b[1::2]):
    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"
    else:
        if s[i] == "R":
            ans = "No"
print(ans)

Submission status: Accepted

Solution code:
s=input()
for n,i in enumerate(s):
    if n%2==0 and i=="L" or n%2==1 and i=="R":
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
s=input()
l=len(s)
for i in range(l):
  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:
string = input()
flg = True
for k, i in enumerate(string):
    if k % 2 == 0:
        if i not in ['R', 'U', 'D']:
            flg = False
    else:
        if i not in ['L', 'U', 'D']:
            flg = False
print('Yes') if flg else print('No')

Submission status: Accepted

Solution code:
s = input()

for ss in s[0::2]:
    if ss == 'L':
        print('No')
        exit()

for ss in s[1::2]:
    if ss == 'R':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc141/tasks/abc141_b
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    s = input()
    for i in range(len(s)):
        num = i + 1
        if num % 2 == 1:
            # odd
            if s[i] not in 'RUD':
                print('No')
                return
        else:
            # even
            if s[i] not in 'LUD':
                print('No')
                return

    print('Yes')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def t():
    for i,d in enumerate(s):
        if (i+1)%2==1:
            if not d in odd:
                return "No"
        else:
            if not d in ev:
                return "No"
    return "Yes"

print(t())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

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
    else:
        if S[i] == "R":
            flag = 1
if flag == 1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

S = str(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()
N=len(S)
flag=1
for i in range(N):
    if i%2==0 and S[i]=="L":
        flag=0
    if i%2==1 and S[i]=="R":
        flag=0
if flag==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

S = input()
ans = 'Yes'
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] not in g:
            ans = 'No'
            break
    else:
        if S[i] not in k:
            ans = 'No'
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)

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

def solve(S: str):
    ret = YES
    for i in range(len(S)):
        if i % 2 == 0 and S[i] in ['R', 'U', 'D']:
            continue
        if i % 2 == 1 and S[i] in ['L', 'U', 'D']:
            continue
        ret = NO
        break
    print(ret)
    return


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:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import heapq
from bisect import bisect_right, bisect_left
from collections import defaultdict, Counter
import itertools
import sys
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7
INF = float("inf")


def main():
    S = list(input())
    flg = True
    for i in range(len(S)):
        if i % 2 == 0:
            if S[i] == "R" or S[i] == "U" or S[i] == "D":
                pass
            else:
                print("No")
                exit()
        else:
            if S[i] == "L" or S[i] == "U" or S[i] == "D":
                pass
            else:
                print("No")
                exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
j=True
for i in range(0,n,2):
	if s[i] not in list("RUD"):
		j=False
for i in range(1,n,2):
	if s[i] not in list("LUD"):
		j=False
print("Yes" if j else "No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ok = True
for i in range(0, n, 2):
	if s[i] == "L":
		ok = False
for i in range(1, n, 2):
	if s[i] == "R":
		ok = False
if ok:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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


def solve():
  S = str(input())
  for i,c in enumerate(S):
    if i%2==0:
      if c not in "RUD":
        return False
    else:
      if c not in "LUD":
        return False
  return True

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

Submission status: Accepted

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

from collections import deque, defaultdict
import itertools as ite
import sys
import math
import decimal

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

S = raw_input()
flag = True
for i in range(len(S)):
    if i % 2 == 0:
        if not S[i] in "RUD":
            flag = False
    else:
        if not S[i] in "LUD":
            flag = False
print "Yes" if flag else "No"

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():

    return

#B
def B():
    s = S()
    for i in range(len(s)):
        if i%2:
            if s[i] not in ["L","U","D"]:
                print("No")
                return
        else:
            if s[i] not in ["R","U","D"]:
                print("No")
                return
    print("Yes")
    return

#C
def C():

    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Runtime Error

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N,K,Q = MI()

X = [0]*(N+1)  # 各参加者の正解数
for _ in range(Q):
    a = I()
    X[a] += 1

for i in range(1,N+1):
    x = X[i]
    print('Yes' if K-(Q-x) > 0 else 'No')

Submission status: Runtime Error

Solution code:
S = input()

N = len(S)
# Sの各文字は'L', 'R', 'U', 'D'のいずれかであることに注意する
# 1,3,...文字目が'L'でなく、偶数文字目が'R'でないとき 'Yes'とする
for i in range(N):
  if (i % 2 == 0 and S[i] == 'L') or (i % 2 == 1 and S[i] == 'R'):
    ans = 'No'
    break
    
print(ans)

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())

Ans = True
for i in range(0, len(S)):
  if i % 2 == 0:
    if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
    else:
      Ans = False
      break
  if i % 2 != 0:
    if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
    else:
      Ans = False
      break
else:
  print('Yes')
  
if Ans == False:
  print('No')

Submission status: Runtime Error

Solution code:
S = input()

num_array = [S]

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

Submission status: Runtime Error

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353
import numpy

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
str = input()
ans = "Yes"
for i in len(str):
  if (i + 1) % 2 == 0 and str[i] not in ('L', 'U', 'D'):
    ans = "No"
  if (i + 1) % 2 == 1 and str[i] not in ('R', 'U', 'D'):
    ans = "No"

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

check = True
for i, s in enumerate(S):
  if (i+1)%2 == 0:
    if not(s == "L" or s == "U" or s == "D"):
      check = False
  else:
    if not(s == "R" or s == "U" or s ="D"):
      check = False

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

Submission status: Runtime Error

Solution code:
import sys
S = list(input())
S_odd = S[::2]
S_even = S[1::2]
easy_odd = ['R','U','D']
easy_even = ['L','U','D']

print('Yes') if set(S_odd).issubset(easy_odd) and set(S_even).issubset(easy_even) else 
    print('No'

Submission status: Runtime Error

Solution code:
S=input()
print("NYoe s"[len(re.sub("[RUD]",'',S[0::2]))==0==len(re.sub("[LUD]",'',S[1::2]))::2])

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define pri_que priority_queue
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    string s; cin >> s;
    int n=s.size();
    rep(i,n){
        if(i%2==1){
            if(s[i]!='L' && s[i]!='U' && s[i]!='D'){
                coutn; return 0;
            }
        }else{
            if(s[i]!='R' && s[i]!='U' && s[i]!='D'){
                coutn; return 0;
            }
        }
    }
    couty;
}