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):
s = list(str(input()))

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

if s[0] in ['R','U','D']:
    pass
else:
    flag = False
            
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
kisuu = ['R', 'U', 'D']
guusuu = ['L', 'U', 'D']
for i in s[::2]:
    if i in kisuu:
        continue
    else:
        print('No')
        quit()
for j in s[1::2]:
    if j in guusuu:
        continue
    else:
        print('No')
        quit()
print('Yes')

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

count = 0

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

print(ans)

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

Solution (Python):
s = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']
fl = True
ans = 'Yes'
for i in s:
  if fl:
    fl = False
    if kisu.count(i) == 0:
      ans = 'No'
      break
  else:
    fl = True
    if gusu.count(i) == 0:
      ans = 'No'
      break

print(ans)

Solution (Python):
import sys
s = input()
for i, notes in enumerate(s):
    if i%2 == 1:
        if notes == 'R':
            print('No')
            sys.exit()
    else:
        if notes == 'L':
            print('No')
            sys.exit()
print('Yes')

Solution (Python):
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
    cnt += 1
print(result)

Solution (Python):
S = list(input())
N = len(S)
output = "Yes"
for i in range(N):
    if (i%2==1)and(S[i] not in ["L","U","D"]):
        output="No"
    if (i%2==0)and(S[i] not in ["R","U","D"]):
        output="No"
print(output)

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

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

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

Solution (Python):


a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "L":
        print("No")
        flag = "unko"
    else:
        pass
elif amari == 0:
    for i in range (1, (int(n) // 2)+1):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)+1):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass
    if a[int(n) - 1] == "L" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Solution (Python):


def main():
    s = input()
    so = s[::2]
    se = s[1::2]
    if set(so) <= {"R", "U", "D"} and set(se) <= {"L", "U", "D"}:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Solution (Python):
even = ('L','U','D')
odd = ('R','U','D')

step = (even,odd)
s = input()
for i in range(len(s)):
  c = s[i]
  if c in step[1- i%2]:
    continue
  else:
    print('No')
    break
else:
  print('Yes')

Solution (Python):
s=list(input())
count=0
for i in range(0,len(s),2):
    if s[i]=='L':
        count+=1

for j in range(1,len(s),2):
    if s[j]=='R':
        count+=1

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

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

Solution (Python):
s = input()

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

Solution (Python):
S=list(input())
def main():
    while True:
        for i in range(len(S)):
            if (i+1)%2==1:
                if S[i]!='R' and S[i]!='U' and S[i]!='D':
                    return 'No'
                    break
            else:
                if S[i]!='L' and S[i]!='U' and S[i]!='D':
                    return 'No'
                    break
                
        return 'Yes'

print(main())

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

Solution (Python):
s = input()
r = "R","U","D"
l = "L","U","D"


yes = True
for i in range(len(s)):
    if i%2==0 and s[i] not in r: 
        yes = False
        break
    if i%2==1 and s[i] not in l: 
        yes = False
        break
        
print("YNeos"[not yes::2])

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

Solution (Python):
s = input()

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

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

for i in range(N):
    if i%2==0:
        if S[i] == 'L':
            print('No')
            quit()
    else:
        if S[i] == 'R':
            print('No')
            quit()
print('Yes')

Solution (Python):
S = input()

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

print('Yes')

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

Solution (Python):
import sys
s = input()

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

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

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

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

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

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

Solution (Python):
s = input()

flag = 0

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

Solution (Python):
S = list(input())
odd, even = [], []
for i, v in enumerate(S):
    if i % 2 == 0:
        if v == "R" or v == "U" or v == "D":
            continue
        else:
            odd.append(v)
            break

    else:
        if v == "L" or v == "U" or v == "D":
            continue
        else:
            even.append(v)
            break

print("No") if odd or even else print("Yes")

Solution (Python):
S = list(input())
odd = []
even = []
for i, v in enumerate(S):
    if i % 2 == 0:
        if v == "R" or v == "U" or v == "D":
            pass
        else:
            odd.append(v)

    else:
        if v == "L" or v == "U" or v == "D":
            pass
        else:
            even.append(v)

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

Solution (Python):
s = input()
for i in range(len(s)):
  if (i+1)/2 != int((i+1)/2):
    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')

Solution (Python):
s=list(input())
s_o = s[::2]
s_e = s[1::2]

od = ["R","U","D"]
ev = ["L","U","D"]

for i in range(len(s_o)):
    if (s_o[i] not in od):
        print("No")
        exit()

for i in range(len(s_e)):
    if (s_e[i] not in ev):
        print("No")
        exit()
print("Yes")

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

Solution (Python):



def main():
  for i, c in enumerate(input().strip(), 1):
    if (i%2 == 1 and c == 'L') or (i%2 == 0 and c == 'R'):
      print('No')
      return 
  print('Yes')

if __name__=='__main__':
  main()

Solution (Python):
Tap = input()
len_Tap = len(Tap)
count = 0

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

if count == len_Tap:
    print('Yes')

else:
    print('No')

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

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

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

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

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

Solution (Python):


def f(array, ch):
    res = True
    for i in array:
        if i == ch:
            res = False
            break
    return res

def main():
    s = input()
    odd = [s[i] for i in range(len(s)) if i%2 == 0 ] 
    even = [s[i] for i in range(len(s)) if i%2 != 0]
    if f(odd, 'L') and f(even, 'R'):
        print('Yes')
    else:
        print('No')
main()

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

print(check)

Solution (Python):
s = input()

odd = ['R','U','D']
even = ['L','U','D']

judge = True

for i in range(len(s)):
    if i%2 == 0:
        if s[i] in odd:
            pass
        else:
            judge = False
    
    else:
        if s[i] in even:
            pass
        else:
            judge = False


if judge:
    print("Yes")

else:
    print("No")

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

for i in range (0,len(S),2):
    if S[i] == "L":
        s = 1
        break

for i in range (1,len(S),2):
    if S[i] == "R":
        s = 1
        break

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

Solution (Python):
s = input()

a = list(filter(lambda v: v not in ['R', 'U', 'D'], s[0::2]))
b = list(filter(lambda v: v not in ['L', 'U', 'D'], s[1::2]))

print("Yes" if len(a) == len(b) == 0 else "No")

Solution (Python):
S = input()

odd = ["R", "U", "D"]
even = ["L", "U", "D"]

flag = True
for i in range(len(S)):
    if (i + 1) % 2 == 0:
        if S[i] not in even:
            print("No")
            flag = False
            break
    else:
        if S[i] not in odd:
            print("No")
            flag = False
            break

if flag:
    print("Yes")

Solution (Python):
S = input()
a = "Yes"
for i in range(len(S)):
    if (i+1) % 2 == 0 and S[i] in["L", "U", "D"]:

        pass
    elif (i+1) % 2 == 1 and S[i] in["R", "U", "D"]:

        pass
    else:
        a = "No"
print(a)

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

Solution (Python):
S=str(input())
ans='Yes'
for i in range(len(S)):
    if  (i+1)%2==0 and S[i] in ['L','U','D']:
        pass
    elif  (i+1)%2==1 and S[i] in ['R','U','D']:
        pass
    else:
        ans='No'
print(ans)

Solution (Python):
import re

s = input()
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(s):
  print("Yes")
else:
  print("No")

Solution (Python):
S=input()
tmp = [S[i] in 'RUD' for i in range(len(S))[::2]]+[S[j] in 'LUD' for j in range(len(S))[1::2]]
print('YNeos'[False in tmp::2])

Solution (Python):



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

Solution (Python):
ugrd={'L'}
grd={'R'}
s=str(input())
for i in range(len(s)):
  if i%2==0:
    if s[i] in ugrd:
      print('No')
      break
  if i%2==1:
    if s[i] in grd:
      print('No')
      break
  if i==len(s)-1:
    print('Yes')

Solution (Python):
S = input()

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

okOfOdd = len(odd - set(['R', 'U', 'D']))
okOfEven = len(even - set(['L', 'U', 'D']))

if okOfOdd == 0 and okOfEven == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S = IS()
	ans = True
	for i,s in enumerate(S):
		if (i % 2 == 1 and s=='R') or (i % 2 == 0 and s=='L'):
			ans=False
	if(ans):
		print('Yes')
	else:
		print('No')

main()

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

for i in range(len(s)):
    if (i+1) % 2 == 0 and s[i] in ["L", "U", "D"]:
        pass
    elif (i+1) % 2 != 0 and s[i] in ["R", "U", "D"]:
        pass
    else:
        ans = "No"

print(ans)

Solution (Python):
s=input()
print('YNeos'['L'in s[::2]or'R'in s[1::2]::2])

Solution (Python):
S=input()
odd=set(S[0::2])
even=set(S[1::2])
odd_=['R','U','D']
even_=['L','U','D']
flag=0
for i in odd:
    if i not in odd_:
        flag=1
for i in even:
    if i not in even_:
        flag=1
print('Yes' if flag==0 else 'No')

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

    elif s[i] == 'L'or s[i] == 'U'or s[i] == 'D':
        a += 1

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

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

for i,j in enumerate(S):
    if i%2==0:
        
        if j=="R"or j=="U"or j=="D":
            
            continue
        else:
            print("No")
            break
    else:
        if j=="L"or j=="U"or j=="D":
            continue
        else:
            print("No")
            break
else:
    print("Yes")

Solution (Python):




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

    print(result)


if __name__ == "__main__":
    main()

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

flag = True

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

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

for i in range(len(S)):
    if i%2 == 0:
        if S[i] == 'L':
            judge = False

    else:
        if S[i] == 'R':
            judge = False

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

Solution (Python):
import sys
s = input()

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

Solution (Python):
s=input()
r=[]
l=[]
for i,v in enumerate(s):
    if i%2==0:
        r.append(v)
    else:
        l.append(v)
if "L" in r or "R" in l:
    print("No")
else:
    print("Yes")

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

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

Solution (Python):
s = input()

flg = 0

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

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

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

Solution (Python):
S=input()
odd=S[0::2]
even=S[1::2]
if 'L' in odd or 'R' in even:
    print('No')

else:
    print('Yes')

Solution (Python):
S=input()
odd=[]
even=[]

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

    else:
        even.append(S[i])

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

else:
    print('Yes')

Solution (Python):
s=list(input())
flag=True
for i in range(1,len(s)+1):
    v=s[i-1]
    if i%2==0:
        if v=="L" or v=="U" or v=="D":
            pass
        else:
            flag=False
            break
    else:
        if v=="R" or v=="U" or v=="D":
            pass
        else:
            flag=False
            break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
i = 0
while True and i < len(s):
  
  if (i+1) % 2 == 1:
    if s[i] == "L":
      print("No")
      break
  
  if (i+1) % 2 == 0:
    if s[i] == "R":
      print("No")
      break
  if i == len(s)-1:
    print("Yes")
  i += 1

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

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

import collections

c_odds = collections.Counter(s[::2])
c_even = collections.Counter(s[1::2])

if 'L' not in c_odds.keys() and 'R' not in c_even.keys():
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
print(['No', 'Yes'][[(i[::2].count('L')==0)&(i[1::2].count('R')==0) for i in [input()]][0]])

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

b = 0
c = 0
for i in range(len(a)):
    if i % 2 == 1:
        b = b + int(a[i] != "R")
    if i % 2 == 0:
        c = c + int(a[i] != "L")
if b +c == len(a):
    print("Yes")
else:
    print("No")

Solution (Python):
s = 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 == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
N = input()

M = int(len(N))
flag = True

for i in range(M):
  if i % 2 == 0:
    if N[i] == "L":
      flag = False
  else:
    if N[i] == "R":
      flag = False
if flag == False:
  print('No')
else:
  print('Yes')

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

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

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

Solution (Python):
S=input()
Ans="Yes"
even=[i for i in range(len(S)) if i % 2 == 0 ]

for j in even:
    if S[j]=="L":
        Ans="No"
    else:
        pass

odd=[i for i in range(len(S)) if i % 2 ==1 ]

for j in odd:
    if S[j]=="R":
        Ans="No"
    else:
        pass

print(Ans)

Solution (Python):
S=list(input())
even=[]
odd=[]
for i in range(len(S)):
    if i%2==0:
        even.append(S[i])
    else:
        odd.append(S[i])
if not "L" in even and not "R" in odd:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

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

print("Yes")

Solution (Python):
s = str(input())
count = 0

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

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

Solution (Python):
s = input()
on = "RUD"
oe = "LUD"

cnt = 0
for i in range(len(s)):
    if(i%2 == 0 and s[i] in on):
        cnt += 1
    elif(i%2 != 0 and s[i] in oe):
        cnt += 1
    
print("Yes" if cnt == len(s) else "No")

Solution (Python):
S=input()

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

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

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

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

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

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

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

Solution (Python):
s = input()

ans = True
for i in range(len(s)):
    if (i+1) % 2 == 0:
        if not(s[i] in ["L", "U", "D"]):
            ans = False

    else:
        if not(s[i] in ["R", "U", "D"]):
            ans = False

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

Solution (Python):
S = input()
a = map(lambda x:x in {"L","U","D"},S[1::2])
b = map(lambda x:x in {"R","U","D"},S[0::2])
print("Yes" if sum(a)+sum(b)==len(S) else "No")

Solution (Python):
s = input()
flag = 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:
            flag = False
            break
    elif i%2 == 1:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            pass
        else:
            flag = False
            break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
Odd=S[::2]
Even=S[1::2]

X=0
import math
for i in range(math.ceil(len(S)/2)):
    if Odd[i]=="L":
        X+=1

for i in range(len(S)//2):
    if  Even[i]=="R":
        X+=1

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

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

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

Solution (Python):
s=input()

flag=True

for i in range(len(s)):
    if s[i]=='R':
        if (i+1)%2==0:
            flag=False
            break
    if s[i]=='L':
        if (i+1)%2!=0:
            flag=False
            break

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

Solution (Python):
S = str(input())
o = ["L","U","D"]
e = ["R","U","D"]

ans = 1
for i, s in enumerate(S):
  if (i+1) % 2 == 0:
    if s not in o:
      ans = 0
      break
  else:
    if s not in e:
      ans = 0
      break
if ans:
  print("Yes")
else:
  print("No")

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

f = True

for i in range(0, n, 2):
  if s[i] == 'L':
    f = False

for i in range(1, n, 2):
  if s[i] == 'R':
    f = False
    
print("Yes" if f else "No")

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

for i in range(N):
    if i&1:
        if S[i]=='R':
            print('No')
            exit()
    else:
        if S[i]=='L':
            print('No')
            exit()
print('Yes')

Solution (Python):
s=input()
odd=["R","U","D"]
even=["L","U","D"]
l=len(s)
for i in range(l):
    if i % 2==0:
        if s[i] in odd:
            pass
        else:
            print("No")
            exit(0)
    else:
        if s[i] in even:
            pass
        else:
            print("No")
            exit(0)
print("Yes")

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

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

Solution (Python):
import sys
s=list(map(str,input()))
for i in range(len(s)):
    if i%2==0 and s[i]=='L':
        print('No')
        sys.exit()
    else:
        if i%2==1 and s[i]=='R':
            print('No')
            sys.exit()
print('Yes')

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

Solution (Python):
import sys
input=sys.stdin.readline
S=input()
S1=S[::2]
S2=S[1::2]
for i in S1:
    if i == "L":
        print("No")
        exit(0)
for i in S2:
    if i =="R":
        print("No")
        exit(0)
print("Yes")

Solution (Python):
s = input()

even_list = [s[i] for i in range(len(s)) if i % 2 == 0]
odd_list = [s[i] for i in range(len(s)) if i % 2 != 0]

a = set(["R", "U", "D"])
b = set(["L", "U", "D"])

if set(even_list) | a == a and set(odd_list) | b == b:
    print("Yes")
else:
    print("No")

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

Solution (Python):
import sys
s = input()
for i,j in enumerate(s):
    if i%2==0 and j=='L':
        print('No')
        sys.exit()
    elif i%2==1 and j=='R':
        print('No')
        sys.exit()
print('Yes')

Solution (Python):
S = input()
flg = True
for s in range(0,len(S)):
    
    if s%2 == 0 and S[s] == "L":
       
        flg = False
    elif s%2 != 0 and S[s] == "R":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Solution (Python):
s=list(input())
b=True
for x in range(len(s)):
    if (x+1)%2==1:
       if s[x] not in ["R","U","D"]:b=False
    else:
       if s[x] not in ["L","U","D"]:b=False
if b:print("Yes")
else:print("No")

Solution (Python):
s=input()
kisu = s[::2]
gusu = s[1::2]
for i in range(len(kisu)):
  if kisu[i] == "L":
    print("No")
    exit()
for i in range(len(gusu)):
  if gusu[i] == "R":
    print("No")
    exit()
print("Yes")

Solution (Python):
s = input()

yes = True
for i in range(len(s)):
  if s[i] == 'U' or s[i] == 'D':
    continue
  if i % 2 != 0:
    if s[i] == 'L':
      continue
    else:
      yes = False
      break
  else:
    if s[i] == 'R':
      continue
    else:
      yes = False
      break

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

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