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:
n = input()
a = n[0::2]
b = n[1::2]
odd = ['R', 'U', 'D']
even  = ['L', 'U', 'D']
core = 0
for i in a:
    if not i in odd:
        core +=1
for j in b:
    if not j in even:
        core += 1
        
if core ==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
odd=all(s in ('R','U','D') for s in S[::2])
even=all(s in ('L','U','D') for s in S[1::2])
print('Yes' if odd and even else 'No')

Submission status: Accepted

Solution code:
s = input()
def f(s):
    even = False
    for c in s:
        if(even):
            if(c == 'R'):
                return 'No'
            even = False
        else:
            if(c == 'L'):
                return 'No'
            even = True
    return 'Yes'
print(f(s))

Submission status: Accepted

Solution code:
S = input ()

even_clear = 0
odd_clear = 0
number = 1

for value in S:
    if number % 2 == 0 and  not value == "R":
        even_clear += 1

    elif number % 2 == 1  and not value == "L":
        odd_clear += 1
    number += 1

number_pop = number - 1

if number_pop == (even_clear + odd_clear):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
a = []
b = []
n = 0

if len(s) % 2 == 1:
    for i in range((len(s) // 2) + 1):
        a.append(s[2 * i])
else:
    for i in range(len(s) // 2):
        a.append(s[2 * i])
    
for i in range(len(s) // 2):
    b.append(s[2 * i + 1])
    
for i in range(len(a)):
    if a[i] == "L":
        n += 1
        
for i in range(len(b)):
    if b[i] == "R":
        n += 1
        
if n > 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=list(input())
BEST_ODD = ['R', 'U', 'D']
BEST_EVEN = ['L', 'U', 'D']
ANS = 'Yes'
for i,s in enumerate(S):
  o_or_e = (i + 1) % 2
  if o_or_e == 0 and s in BEST_EVEN:
    pass
  elif o_or_e == 1 and s in BEST_ODD:
    pass
  else:
    ANS = 'No'
    break
print(ANS)

Submission status: Accepted

Solution code:
S = input()
if all(c in 'RUD' for c in S[::2]) and all(c in 'LUD' for c in S[1::2]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=list(input())
ans="Yes"
cnt=1
for a in s:
    if cnt%2==0:
        if a =="R":
            ans="No"
    else:
        if a=="L":
            ans = "No"
    cnt+=1
print(ans)

Submission status: Accepted

Solution code:
S = input()
for idx, s in enumerate(S, start=1):
    if idx % 2 == 1 and s == 'L':
        print('No')
        exit(0)
    elif idx % 2 == 0 and s == 'R':
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S_list = list(input())
odd_list = S_list[0::2]
even_list = S_list[1::2]
ans = 'Yes'
for s in even_list:
    if s not in ['L', 'U', 'D']:
        ans = 'No'
for s in odd_list:
    if s not in ['R', 'U', 'D']:
        ans = 'No'
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
list_all = list(input())  
odd = list_all[0::2]
even = list_all[1::2]

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

Submission status: Accepted

Solution code:
S = input()
Odd = ["R", "U", "D"]
Even = ["L", "U", "D"]
f = 0
for index, i in enumerate(S):
    if index % 2 == 0:
        if i == "R" or i == "U" or i == "D":
            pass
        else:
            f = 1
            break
    else:
        if i == "L" or i == "U" or i == "D":
            pass
        else:
            f = 1
            break

if f == 1:
    print("No")

else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input().strip()
odl = ['R', 'U', 'D']
evl = ['L', 'U', 'D']
print('Yes') if all([c in odl for c in S[::2]]) and all([c in evl for c in S[1::2]]) else print('No')

Submission status: Accepted

Solution code:
S = input()
 
is_easy2step = all(i in ['R', 'U', 'D'] for i in S[::2]) and all(i in ['L', 'U', 'D'] for i in S[1::2])
print('Yes' if is_easy2step else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
s = input()

kisu = []
gusu = []
for i in range(len(s)):
    if i % 2 == 0:
        kisu.append(s[i])
    else:
        gusu.append(s[i])


if kisu.count("L") == 0:
    if gusu.count("R") == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
for i, c in enumerate(s):
    if (i % 2 and c == 'R') or (not i % 2 and c == 'L'):
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()

ch = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

is_yes = 'Yes'
for num, s in enumerate(S, start=1):
  if num % 2:
    if s == 'L':
      is_yes = 'No'
  else:
    if s == 'R':
      is_yes = 'No'

print(is_yes)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if all([not 'L'==i  for i in S[0::2]]) and all([not 'R'==i for i in S[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"
            break
    if i%2!=0:
        if s[i]=="R":
            ans="No"
            break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

answer = 'Yes'

for i in range(len(S)):
    if (i % 2 == 0 and S[i] == 'L') or (i % 2 == 1 and S[i] == 'R'):
        answer = 'No'
        break

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()



def yesNo(s):
	for index, char in enumerate(s):
		if index%2==0:
			if char=='L':
				return 'No'
		else:
			if char=='R':
				return 'No'
	return 'Yes'

print(yesNo(s))

Submission status: Accepted

Solution code:
def main():
    array = list(input())
    for i, s in enumerate(array):
        if (i+1) % 2 == 0:
            if array[i] == 'R':
                print('No')
                return
            else:
                continue
        else:
            if array[i] == 'L':
                print('No')
                return
            else:
                continue
    print('Yes')



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
odd = set(s[::2])
if "L" in odd:
  print("No")
  exit()
even = set(s[1::2])
if "R" in even:
  print("No")
  exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()
kisu = []
gusu = []
check = 1
judge = True
for i in s:
    if check == 1:
        kisu.append(i)
        check = 0
    else:
        gusu.append(i)
        check = 1
if kisu.count("L") >= 1:
    judge = False
if gusu.count("R") >= 1:
    judge = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()


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

Submission status: Accepted

Solution code:
s = input()



for i in s[0::2]:
    if(i not in ['R','U','D']):
        print('No')
        exit()

for i in s[1::2]:
    if(i not in ['L','U','D']):
        print('No')
        exit()
        
print('Yes')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()
_ans = 0
_S = len(S)
for s in range(0,_S):
  X = (s) % 2
  if X == 1 :
    if S[s] == 'R':
      _ans += 1
     
  if X == 0 :
    if S[s] == 'L' :
      _ans += 1
  
  
if _ans >= 1:
  print ('No')
elif _ans ==0:
  print ('Yes')

Submission status: Accepted

Solution code:
s = input()
odd_step = ['R', 'U', 'D']
even_step = ['L', 'U', 'D']
number_of_step = len(s)
result = False
for i in range(1, len(s)+1):
    if (i % 2 == 1 and s[i-1] in odd_step) or (i % 2 == 0 and s[i-1] in even_step):
        result = True
    else:
        result = False
        break
if result:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
f = True
for s, i in zip(S, range(1, len(S) + 1)):
    if i % 2 == 0:
        if s == "R":
            f = False
            break
    else:
        if s == "L":
            f = False
            break
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
Sl = list(S)
o = Sl[0::2]
e = Sl[1::2]

if 'R' in e or 'L' in o:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
r = list(input())
n = len(r)
k = r[0:n:2]
g = r[1:n:2]
if 'L' not in k and 'R' not in g:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
count =0
for i in range(len(s)):
	if (i+1) % 2 == 0 : 
		if s[i] =='L' or s[i] =='U' or s[i] =='D':
			count += 1
	else:
		if s[i] =='R' or s[i] =='U' or s[i] =='D':
			count += 1


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

Submission status: Accepted

Solution code:
S = input()

T = list(S)
k = 0
g = 0

i = 0
while i < len(T):
    if (i + 1) % 2 == 1 and T[i] == 'L':
        k = 1
    elif (i + 1) % 2 == 0 and T[i] == 'R':
        g = 1
    i += 1

if k == 0 and g == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
N = input()
b=0

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

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
a=0
for i in range(N):
 if i%2==0:
  if S[i]=="L":
   a+=1
 else:
  if S[i]=="R":
   a+=1
if a==0:
 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 = input()

print(
    "Yes" if all(
        [l in ("R", "U", "D")
         for l in S[::2]] + [r in ("L", "U", "D") for r in S[1::2]]
    ) else "No"
)

Submission status: Accepted

Solution code:
import sys

s = list(input())

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

print("Yes")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s=input()
b=0
for i in range(len(s)):
    if (i+1)%2==0 and s[i]=='R':
        b=1
    elif (i+1)%2==1 and s[i]=='L':
        b=1
print('No' if b else 'Yes')

Submission status: Accepted

Solution code:
S = input()
odd = {'R', 'U', 'D'}
even = {'L', 'U', 'D'}
isEasy = "Yes"
for i in range(0,len(S)):
  isEven = (i + 1) % 2 == 0
  if (isEven and S[i] not in even) or not isEven and S[i] not in odd:
    isEasy = "No"
print(isEasy)

Submission status: Accepted

Solution code:
S = input()
even = ['R','U','D']
odd = ['L','U','D']
if all(c in even if i%2==0 else c in odd for i,c in enumerate(S)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    S = input()
    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()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = True

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = input()

for i in range(0,len(N),2):
    if N[i] == 'L':
        print("No")
        exit()

for i in range(1,len(N),2):
    if N[i] == 'R':
        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):
    flag = YES
    if 'L' in S[::2] or 'R' in S[1::2]:
        flag = NO
    print(flag)
    return


# Generated by 1.1.6 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:
def judge(s):
  for i in range(0,len(s),2):
    if s[i]=='L':
      return "No"
  for j in range(1,len(s),2):
    if s[j]=='R':
      return "No"
  return "Yes"

s=input()
print(judge(s))

Submission status: Accepted

Solution code:
def t(s):
    a = tuple(enumerate(s))
    return 'No' if 'R' in [j for i, j in a if i % 2 != 0] or 'L' in [j for i, j in a if i % 2 == 0] else 'Yes'


if __name__ == "__main__":
    print(t(input()))

Submission status: Accepted

Solution code:
a = input()
b = list(a)
count = 0

for i in range(0, len(b)):
    if i % 2 == 0 and b[i] == 'L':
        count += 1
        print('No')
        break
    if i % 2 == 1 and b[i] == 'R':
        count += 1
        print('No')
        break
if count == 0:
    print('Yes')

Submission status: Accepted

Solution code:
dance = ["L","R","U","D"]

S = input()

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

Submission status: Accepted

Solution code:
S = list(input())
L = len(S)
ans = 1

for i in range(L):
    if i % 2 == 0:
        if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
            continue
        else:
            ans = 0
    else:
        if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
            continue
        else:
            ans = 0

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

Submission status: Accepted

Solution code:
S = input()
s1 = set(S[0::2])
s2 = set(S[1::2])
if s1.issubset(set("RUD")) and s2.issubset(set("LUD")):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
show_flg=True
ans=math.log(3,3)
an=0
k=0
s=list(input())
n=len(s)
d=[['R','U','D'],['L','U','D']]
for i in range(n):
    if s[i] in d[k]:
        0
    else:
        an=1
    k=1-k
    
print(YN[an])

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
ts=time.time()
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
show_flg=True

an=0
k=0
s=list(input())
n=len(s)
d=[['R','U','D'],['L','U','D']]
for i in range(n):
    if s[i] in d[k]:
        0
    else:
        an=1
    k=1-k
    
print(YN[an])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
ts=time.time()
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
show_flg=False
show_flg=True

an=0
k=0
s=list(input())
n=len(s)
d=[['R','U','D'],['L','U','D']]
for i in range(n):
    if s[i] in d[k]:
        0
    else:
        an=1
    k=1-k
    
print(YN[an])

Submission status: Accepted

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

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:
s=input()
for i in range(len(s)):
      if i%2==0 and s[i]=='L':
            print("No")
            exit()
      if i%2==1 and s[i]=='R':
            print("No")
            exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

cnt = 0
ans = 'Yes'

for s in S:
	if cnt%2 == 0:
		if s != 'R' and s != 'U' and s != 'D':
			ans = 'No'
	else:
		if s != 'L' and s != 'U' and s != 'D':
			ans = 'No'
	cnt+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strings = input()
c = 1
res = 'Yes'
for i in strings:
    if ((c % 2 == 0 and i == 'L') or (c % 2 == 1 and i == 'R')) or i == "U" or i == 'D':
        pass
    else:
        res = 'No'
        break
    c += 1
print(res)

Submission status: Accepted

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

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()
for i in range(len(S)):
  if i%2==0:
    if S[i] in ['R', 'U', 'D']:
      continue
    else:
      print('No')
      break
  else:
    if S[i] in ['L', 'U', 'D']:
      continue
    else:
      print('No')
      break
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

odd=S[0::2] #(start,end,step)
even=S[1::2] #(start,end,step)

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

Submission status: Accepted

Solution code:
s=input()
s2=s[0: :2]
s1=s[1: :2]
ans=0

for i in range(len(s1)):
    if s1[i]=='L' or s1[i]=='U' or s1[i]=='D':
        ans+=1
    else:
        print('No')
        break

if ans==len(s1):   
    for i in range(len(s2)):
        if s2[i]=='R' or s2[i]=='U' or s2[i]=='D':
            ans+=1
        else:
            print('No')
            break
        
if ans==len(s):
    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 = list(input())
len(S)

count=1
for k in S:
    if count%2 != 0:
        if k != "R" and k != "U" and k != "D":
            break
    elif count%2 == 0:
        if k != "L" and k != "U" and k != "D":
            break
    count += 1

if count-1 == len(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = raw_input()
ans = "Yes"

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

Submission status: Accepted

Solution code:
import sys

#S:文字列
S=input()

if S.count("U")+S.count("D")+S[0::2].count("R")+S[1::2].count("L")==len(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

for i,str in enumerate(S):
    if i%2==0:
        if str=='L':
            flag = 'No'
    else:
        if str=='R':
            flag = 'No'


print(flag)

Submission status: Accepted

Solution code:
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
if ans:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
oddSet = set(['R', 'U', 'D'])
evenSet = set(['L', 'U', 'D'])
for idx, ch in enumerate(S):
	if(idx % 2 == 0):
		if(ch not in oddSet):
			print("No")
			exit(0)
	else:
		if(ch not in evenSet):
			print("No")
			exit(0)
print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
#入力
S=input()
#処理
while True:
    if S=="":
        print("Yes")
        break
    elif S[0]=="L":
        print("No")
        break
    
    if S[1:]=="":
        print("Yes")
        break
    elif S[1]=="R":
        print("No")
        break
        
    S=S[2:]

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
odd = ['R','U','D']
even = ['L', 'U', 'D']
S = input()
for s in S[::2]:
  if s not in odd:
    print('No')
    exit()
    
for s in S[1::2]:
  if s not in even:
    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'
            break
    else:
        if S[i] == 'R':
            ans = 'No'
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc141/tasks/abc141_b
s = input()
sr = s[::2].replace("R", "").replace("U", "").replace("D", "")
sl = s[1::2].replace("L", "").replace("U", "").replace("D", "")
if sr or sl:
    print("No")
    exit()
print("Yes")