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

Solution (Python):


import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    for s in S[1::2]:
        if s == 'R':
            print('No')
            return
    for s in S[0::2]:
        if s == 'L':
            print('No')
            return
    print('Yes')
    return

main()

Solution (Python):
S = input()

S1 = set(['R', 'U', 'D'])
S2 = set(['L', 'U', 'D'])
flag = 'Yes'
if not all(x in S1 for x in S[0::2]):
    flag = 'No'
if not all(x in S2 for x in S[1::2]):
    flag = 'No'
print(flag)

Solution (Python):
s=input()
n=len(s)

res=0
for i in range(n):
  if s[i]=="U" or s[i]=="D":
    1
  else:
    if i%2==1 and s[i]=="L":
      1
    elif i%2==0 and s[i]=="R":
      1
    else:
      res=1
print("Yes" if res == 0 else "No")

Solution (Python):
easy = [["L","U","D"],["R","U","D"]]
S = list(input())
ans = "Yes"
for i, s in enumerate(S):
  if not (s in easy[(i+1)%2]):
    ans = "No"
    break
print(ans)

Solution (Python):
s = input()

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

Solution (Python):
import sys

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

Solution (Python):
S = input()

odd_strp = ['R','U','D']
even_step = ['L', 'U', 'D']

for ix, c in enumerate(S):
    if ix & 1:
        if c in even_step:
            pass
        else:
            print("No")
            exit()
    
    else:
        if c in odd_strp:
            pass
        else:
            print("No")
            exit()

print("Yes")

Solution (Python):
s = input()
kisuu = s[::2]
gusuu = s[1::2]
flag = 0
for i in range(len(kisuu)):
    if kisuu[i] == "L":
        flag = 1
for i in range(len(gusuu)):
    if gusuu[i] == "R":
        flag = 1
if flag == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

flag = True
for i, si in enumerate(s):
    if (i+1) % 2 == 1:
        if not si in ["R", "U", "D"]:
            flag = False
            break
    else:
        if not si in ["L", "U", "D"]:
            flag = False
            break
        
if flag:
    print("Yes")
else :
    print("No")

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

Solution (Python):


s = input()


footable = True
for i,si in enumerate(s):

    if (i+1)%2!=0 :
        if si=='L':
            footable = False
            break
    else:
        if si=='R':
            footable = False
            break

print('Yes' if footable else "No")

Solution (Python):
S = str(input())
odd = "RUD"
even = "LUD"
frag = True
for i in range(len(S)):
    if i%2 == 0 and S[i] not in odd:
        frag = False
        break
    elif i%2 != 0 and S[i] not in even:
        frag = False
if frag:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
input = sys.stdin.readline
from operator import itemgetter

def main():
    v = input().strip()
    for i in range(len(v)):
        if i % 2 == 0:
            if v[i] not in ('R', 'U', 'D'):
                print('No')
                return
        elif i % 2 == 1:
            if v[i] not in ('L', 'U', 'D'):
                print('No')
                return
    print('Yes')

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

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

Solution (Python):
import sys
readline = sys.stdin.readline
S = readline().strip()
N = len(S)
if any([S[i] == 'L' for i in range(0, N, 2)]) or any([S[i] == 'R' for i in range(1, N, 2)]):
    print('No')
else:
    print('Yes')

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

Solution (Python):
str = input()
flg = 1
for i in str:
  if(flg==1):
    if(i=="L"):
      print("No")
      flg = 2
      break;
  else:
    if(i=="R"):
      print("No")
      flg = 2
      break;
  flg *=-1
if(flg!=2):
  print("Yes")

Solution (Python):
ip = lambda : map(int, input().split())


S = input()
for i in range(1,1+len(S)):
    if (i%2==1 and S[i-1]=='L') or (i%2==0 and S[i-1]=='R'):
        print('No')
        exit()
print('Yes')

Solution (Python):
if __name__ == '__main__':
    S = input()
    for i, c in enumerate(S):
        if i % 2 == 1:
            if c not in list('LUD'):
                print('No')
                exit()
        else:
            if c not in list('RUD'):
                print('No')
                exit()
    print('Yes')

Solution (Python):
s=list(input())
kisu=["R","U","D"]
gusu=["L","U","D"]
bool = True
for i in range(len(s)):
    if i%2==0:
        if s[i] not in kisu:
            bool=False
    else:
        if s[i] not in gusu:
            bool=False
print("Yes" if bool else "No")

Solution (Python):
import sys

def resolve():
  s = input()
  for i in range(len(s)):
      if (i+1) %2 == 0:
          if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
              print('No')
              return
      else:
          if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
              print('No')
              return

  print('Yes')
  return


if __name__ == "__main__":
    resolve()

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

Solution (Python):


import sys

S = str(input())
odd = ["R","U","D"]
even = ["L","U","D"]
for i in range(len(S)):
    if (i+1) % 2 == 0:
        if S[i] not in even:
            print("No")
            sys.exit()
    else:
        if S[i] not in odd:
            print("No")
            sys.exit()
print("Yes")

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    S = ST()
    for i,s in enumerate(S,start = 1):
        if i&1:
            if s == "L":
                print("No")
                exit()
        else:
            if s == "R":
                print("No")
                exit()
    print("Yes")
if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
s1 = S[0::2]
s2 = S[1::2]
if ("L" not in s1) and ("R" not in s2):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
gu = set(["R", "U", "D"])
ki = set(["L", "U", "D"])
print("Yes" if (set(S[::2]) <= gu) and (set(S[1::2]) <= ki) else "No")

Solution (Python):
S = input()

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

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

Solution (Python):
S = input()

kisu = "RUD"
gusu = "LUD"

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

Solution (Python):
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')

Solution (Python):
S=input()

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

Solution (Python):
s=input()
if len(s)==1:
  s+="U"
if all(x in "RUD" for x in s[::2]) and all(y in "LUD" for y in s[1::2]):
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
ans1 = True
for s in S[1::2]:
    if s not in ['L','U','D']:
        ans1 = False
        break
for s in S[0::2]:
    if s not in ['R','U','D']:
        ans1 = False
print("Yes" if ans1 else "No")

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

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

Solution (Python):
S=input()

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

Solution (Python):
s = input()
nocounter = 0
n = len(s)
 
for i in range(n):
  if (i % 2 == 0):
    if s[i] == "L":
      print("No")
      nocounter = 1
      break
  if (i % 2 == 1):
    if s[i] == "R":
      print("No")
      nocounter = 1
      break
      
if (nocounter == 0):
  print("Yes")

Solution (Python):
S = input()
isTappable = True
for i,e in enumerate(S):
    if i % 2 == 0:
        
        if e == 'L':
            isTappable = False
    else:
        if e == 'R':
            isTappable = False

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

Solution (Python):
S = input()
ans = "Yes"
for i in range(len(S)):
    if i%2 == 0:
        if S[i] != "R" and  S[i] !="U" and S[i] !="D":
            ans ="No"
    if i%2 != 0:
        if S[i] != "L" and  S[i] !="U" and S[i] !="D":
            ans ="No"
print(ans)

Solution (Python):
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]






r = ["U", "D", "R"]
l = ["U", "D", "L"]
s = input()

ans = "Yes"
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] not in r:
            ans = "No"
    else:
        if s[i] not in l:
            ans = "No"
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    s=input()
    hu="Yes"
    for i in range(len(s)):
        if s[i]=="L" and i%2==0:
            hu="No"
            break
        elif s[i]=="R" and i%2!=0:
            hu="No"
            break
    print(hu)

if __name__ == "__main__":
    main()

Solution (Python):
s = input()
res = "Yes"

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

Solution (Python):
S = input()
F = 'LR'
for i, s in enumerate(S):
  if s == F[i % 2]:
    print('No')
    break
else:
  print('Yes')

Solution (Python):
s=input()
o=s[::2]
e=s[1::2]
if ("L" in o or "R" in e):
  print("No")
else:
  print("Yes")

Solution (Python):
import sys
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')
            sys.exit()
    else:
        if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
            continue
        else:
            print('No')
            sys.exit()

print('Yes')

Solution (Python):



def judge(s):
    for i, c in enumerate(s):
        if i % 2 == 0 and c == "L" or i % 2 == 1 and c == "R":
            return False
    return True


def main():
    s = input()
    print("Yes" if judge(s) else "No")


if __name__ == "__main__":
    main()

Solution (Python):
S = input()

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

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

Solution (Python):
S = input().strip()

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

Solution (Python):
S=input()

arr=[]
for i in set(S[0::2]):
    arr.append(i in ['R', 'U', 'D'])
for j in set(S[1::2]):
    arr.append(j in ['L', 'U', 'D'])
print('Yes' if all(arr) else 'No')

Solution (Python):
s = input()
ki = ["R", "U", "D"]
gu = ["L", "U", "D"]

flag = True
for i, s in enumerate(s):
  if (i+1) % 2 == 1:
    if s not in ki:
      flag = False
  else:
    if s not in gu:
      flag = False
if flag:
  print("Yes")
else:
  print("No")

Solution (Python):
S = list(input())

is_easy = True
for i in range(len(S)):
    if i % 2 == 1:
        if S[i] not in ['L', 'U', 'D']:
            is_easy = False
    if i % 2 == 0:
        if S[i] not in ['R', 'U', 'D']:
            is_easy = False

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

Solution (Python):
s = input()

for i, c in enumerate(s):
    if i % 2 == 0:
        if c not in {'R', 'U', 'D'}:
            print('No')
            break
    else:
        if c not in {'L', 'U', 'D'}:
            print('No')
            break
else:
    print('Yes')

Solution (Python):


import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7


S = list(input().rstrip())
odd = S[::2]
even = S[1::2]

for c in odd:
    if c == 'R' or c == 'U' or c == 'D':
        pass
    else:
        print('No')
        exit()

for c in even:
    if c == 'L' or c == 'U' or c == 'D':
        pass
    else:
        print('No')
        exit()

print('Yes')

Solution (Python):
S = input()

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

print('Yes')

Solution (Python):
a = ['R', 'U', 'D']
b = ['L', 'U', 'D']

S = input()
for s in S[::2]:
    if s not in a:
        print('No')
        exit()
if len(S) > 1:
    for s in S[1::2]:
        if s not in b:
            print('No')
            exit()
print('Yes')

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

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

Solution (Python):
S = input()
ans = 'Yes'
for idx, val in enumerate(S):
    if idx % 2 == 1:
        if val == 'R':
            ans = 'No'
    if idx % 2 == 0:
        if val == 'L':
            ans = 'No'

print(ans)

Solution (Python):
S = list(input())
if (set(S[0::2]) <= {"R", "U", "D"}) and (set(S[1::2]) <= {"L", "U", "D"}):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
i = 1
ok = True
for s in S:
    if i%2==1 and s == "L":
        ok = False
    elif i % 2 == 0 and s == "R":
        ok = False
    i += 1
print("Yes") if ok else print("No")

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    s = SI()

    odd = s[0::2]
    even = s[1::2]
    dprint(even, odd)
    if set(even) - set(['L', 'U', 'D']) == set() and set(odd) - set(['R', 'U', 'D']) == set():
        print('Yes')
    else:
        print('No')

solve()

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


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


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    S = 'T' + input()
    odd = ['R','U','D']
    even = ['L','U','D']
    for i in range(1,len(S)):
        if i % 2 == 0:
            if S[i] not in even:
                print('No')
                exit()
        if i % 2 == 1:
            if S[i] not in odd:
                print('No')
                exit()

    print('Yes')


main()

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

Solution (Python):
S=input()
n=len(S)
res="Yes"
for i in range(1,n+1):
    if i%2==1 and S[i-1]=="L":
        res="No"
    if i%2==0 and S[i-1]=="R":
        res="No"
print(res)

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

Solution (Python):
s = input()

s_odd = s[::2]
s_even = s[1::2]

if all(list(map(lambda x: x in ['R', 'U', 'D'], s_odd))) and all(list(map(lambda x: x in ['L', 'U', 'D'], s_even))):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
result = "Yes"
flag = True
for i in S:
    if flag:
        if i == "L":
            result = "No"
            break
    else:
        if i == "R":
            result = "No"
            break
    flag = not flag
print(result)

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	S = input()
	S = S[:-1]

	flg = True

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

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

	print("Yes")



if __name__ == "__main__":
	main()

Solution (Python):
def do():
    frag = 1
    S = str(input())
    for i in range(len(S)):
        if (i+1)%2 == 1:
            if S[i] == 'L':
                frag = 0

        else:
            if S[i] == 'R':
                frag = 0

    if frag == 1:
        print('Yes')
    else:
        print('No')
            
if __name__ == '__main__':
    do()

Solution (Python):
def solve(S):
    for i in range(1, len(S)+1):
        c = S[i-1]
        if i % 2 == 1 and c not in "RUD":
            return "No"
        if i % 2 == 0 and c not in "LUD":
            return "No"
    return "Yes"
                

def main():
    S = input().strip()
    print(solve(S))

main()

Solution (Python):
s=input()

flag=True

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

Solution (Python):
S = list(input())
N = len(S)

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

if(count == N):
 print('Yes')
else:
 print('No')

Solution (Python):
s = str(input())
n = len(s)
ans = 'Yes'
for i in range(n):
    if (i+1)%2==1:
        if s[i]=='R' or s[i]=='U' or s[i]=='D':
            continue
        else:
            ans ='No'
            break
    else:
        if s[i]=='L' or s[i]=='U' or s[i]=='D':
            continue
        else:
            ans='No'
            break
print(ans)

Solution (Python):


def main():
    S = input().strip()
    Ans = 'Yes'
    for i,Si in enumerate(S):
        if i % 2 == 0:
            if not Si in ['R','U','D']:
                Ans = 'No'
                break
        else:
            if not Si in ['L','U','D']:
                Ans = 'No'
                break
    print(Ans)


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
ans = True
for i in range(len(s)):
    if i % 2 == 0 and not s[i] in "RUD":
        ans = False
    elif i % 2 == 1 and not s[i] in "LUD":
        ans = False

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

Solution (Python):
S = input()
if 'L' in [S[i] for i in range(0, len(S), 2)] or 'R' in [S[i] for i in range(1, len(S), 2)]:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

S = input().rstrip()

bl = True
for x in S[::2]:
    if x == 'L':
        bl = False
for x in S[1::2]:
    if x == 'R':
        bl = False

answer = 'Yes' if bl else 'No'
print(answer)

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

Solution (Python):
S = input()
N = len(S)
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

for i in range(0, N, 2):
    if S[i] not in odd:
        print('No')
        exit()

for i in range(1, N, 2):
    if S[i] not in even:
        print('No')
        exit()

print('Yes')

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

cnt=1
for i in s:
  if cnt%2==1:
    if i not in odd:
      print("No")
      exit()
  else:
    if i not in even:
      print("No")
      exit()
  cnt+=1
print("Yes")

Solution (Python):
S = input()
isEven = True

ans = True

for c in S:
    if isEven and c == "L":
        ans = False
        break
    if not isEven and c == "R":
        ans = False
        break

    isEven = not isEven

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

Solution (Python):
S = input()

for i, s in enumerate(S):

    if i % 2 == 0 and s not in ['R', 'U', 'D']:
        print('No')
        break
    elif i % 2 != 0 and s not in ['L', 'U', 'D']:
        print('No')
        break
else:
    print('Yes')

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

Solution (Python):


def main():
    S = input()
    N = len(S)
    for i in range(0, N, 2):
        if S[i] == "L":
            print("No")
            return
    for i in range(1,N,2):
        if S[i] == "R":
            print("No")
            return
    print("Yes")
if __name__ == '__main__':
    main()

Solution (Python):
s=list(input())
ans="Yes"
l=len(s)
for i in range(l//2):
    if(s[i*2+1]=="R"):
        ans="No"
for i in range((l//2)+(l%2)):
    if(s[i*2]=="L"):
        ans="No"
print(ans)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
S = input()
g = []
k = []
ans = 1
for i,s in enumerate(S):
    if i % 2 == 0:
        if s == "L":
            ans *= 0
    else:
        if s == "R":
            ans *= 0
if ans ==0:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()

f = 0
for i in s:
    if f == 0:
        if not i in ['R', 'U', 'D']:
            print("No")
            exit()
    else:
        if not i in ['L', 'U', 'D']:
            print("No")
            exit()


    f = 1 - f
print("Yes")

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

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

Solution (Python):
def main():
    S = input()
    for index, s in zip(range(len(S)), list(S)):
        
        if (index + 1) % 2 == 1 and s == "L":
            print("No")
            return
        
        elif (index + 1) % 2 == 0 and s == "R":
            print("No")
            return

    print("Yes")

if __name__ == "__main__":
    main()

Solution (Python):
s=input()

f=1

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

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

Solution (Python):
S = list(input())
mod2 = False
flag = True
for i in S:
    if mod2:
        mod2 = False
        if i == 'R':
            flag = False
            break
    else:
        mod2 = True
        if i == 'L':
            flag = False
            break

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

Solution (Python):
S = list(input())

ok = True
for i in range(len(S)):
    banme = i + 1

    if banme % 2 == 1:
        if S[i] == "R" or S[i] == "U" or S[i] == "D":
            pass
        else:
            ok = False
    else:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
            pass
        else:
            ok = False

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

Solution (Python):
def main():
    S = input()
    for i, s in enumerate(S):
        if i % 2 == 0:
            if s not in ["R", "U", "D"]:
                print("No")
                exit()
        else:
            if s not in ["L", "U", "D"]:
                print("No")
                exit()

    print("Yes")

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

a1 = ["R","U","D"]
a2 = ["L","U","D"]

for i in range(len(s)):
	if i % 2 == 0:
		if a1.count(s[i]) == 0:
			print("No")
			exit()
	else:
		if a2.count(s[i]) == 0:
			print("No")
			exit()
print("Yes")

Solution (Python):
s = input()

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

for i in even:
    if i not in ["R", "U", "D"]:
        print("No")
        exit()

for i in odd:
    if i not in ["L", "U", "D"]:
        print("No")
        exit()

print("Yes")

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

S = input().strip()

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

print("Yes")

Solution (Python):
import sys; from collections import deque; readline = sys.stdin.readline;

S = readline().rstrip()

L,R, U, D = 'L', 'R', 'U', 'D'

if all(a == R or a == U or a == D for a in S[0::2]) and all(a==L or a==U or a==D for a in S[1::2]):
    print('Yes')
else:
    print('No')

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000)
from math import factorial, ceil, floor
from bisect import bisect_right as bsr
from operator import itemgetter as ig
from collections import defaultdict as dd
from collections import deque, Counter as cnt


args = None
INF = float("inf")
MOD = int(1e9 + 7)
def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]
def nlist(n, v):
    if not n: return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def main():
    S = input(str)
    for s in S[::2]:
        if s == "R" or s == "U" or s == "D":
            continue
        print("No")
        return

    for s in S[1::2]:
        if s == "L" or s == "U" or s == "D":
            continue
        print("No")
        return
    print("Yes")
    return

if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

Solution (Python):
s = input()
even = 'RUD'
odd = 'LUD'
print('Yes' if all(c in even for c in s[::2]) and all(
    c in odd for c in s[1::2]) else 'No')