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 = str(input())
odd_number = [word for i, word in enumerate(S) if (i + 1) % 2 == 1]
even_number = [word for i, word in enumerate(S) if (i + 1) % 2 == 0]

odds = set(odd_number) - set(["R", "U", "D"])
evens = set(even_number) - set(["L", "U", "D"])
del odd_number, even_number, S

if len(odds) == 0 and len(evens) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):

"""
Created on Fri Sep 13 22:46:19 2019

"""

S=input()
ODD = S[0::2]
EVEN = S[1::2]

if ("L" not in ODD) and ("R" not in EVEN):
    print('Yes')
else :
    print('No')

Solution (Python):
s = [i for i in input()]
flg=0
ki = ['R', 'U', 'D']
gu = ['L', 'U', 'D']

for i in range(len(s)):
    if i%2==0:
        if s[i] not in ki:
            flg=1
            break
    elif i%2==1:
        if s[i] not in gu:
            flg=1
            break
        
print('Yes' if flg==0 else 'No')

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

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

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

if set(odd).issubset({'R','U','D'}) and set(even).issubset( {'L','U','D'}):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

ans="No"
for i in range(len(s)):
	c=s[i]
	if i%2==0:
		if c=='L': break
	else:
		if c=='R': break
else:
	ans="Yes"

print(ans)

Solution (Python):
S = input()
l = len(S)
flag=0
for k in range(0,l):
    if k %2 == 1:
        continue
    if not S[k] in 'RDU':
        flag=1
        break

flag2=0
for k in range(0,l):
    if k%2 == 0:
        continue
    if not S[k] in 'LUD':
        flag2=2
        break

if flag==1 or flag2==2:
    print('No')
else:
    print('Yes')

Solution (Python):
steps= input()
stepa = steps[::2]
stepb = steps[1::2]
if stepa.count("L") == 0 and stepb.count("R") == 0:
    print("Yes")
else:
    print("No")

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

print(ans)

Solution (Python):
ans = True
lis = [["R","U","D"],["L","U","D"]]
for i,j in enumerate(input()):
    if not j in lis[i%2]:
        ans = False
if ans:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

S1 = S[1::2]
S2 = S[::2]



for s1 in S1:
	if s1 == "L":
		continue
	elif s1 == "U":
		continue
	elif s1 == "D":
		continue
	else:
		print("No")
		exit()

for s2 in S2:
	if s2 == "R":
		continue
	elif s2 == "U":
		continue
	elif s2 == "D":
		continue
	else:
		print("No")
		exit()
		
print("Yes")

Solution (Python):
odd = list('RUD')
evn = list('LUD')
S = list(input())

flag = True
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] in odd:
            pass
        else:
            flag = False
            break
    else:
        if S[i] in evn:
            pass
        else:
            flag = False
            break
if flag:
    print('Yes')
else:
    print('No')

Solution (Python):
a=input()
s=len(a)
f=False
for i,s in enumerate(a):
    if i%2==0 and s=='L':
        print("No")
        f=True
        break
    if i%2!=0 and s=='R':
        print("No")
        f=True
        break
if not f:
    print("Yes")

Solution (Python):
S = input()



flag = True
for i in range(len(S)):
    
    
    if (i + 1) % 2 == 1:
        if not (S[i] == 'R' or S[i] == 'U' or S[i] == 'D'):
            flag = False
    else:
        if not(S[i] == 'L' or S[i] == 'U' or S[i] == 'D'):
            flag = False
            
            


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

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

Solution (Python):
S = input()
A = 'RUD'; B = 'LUD'
ok = 1
for i, c in enumerate(S):
    if i % 2 == 0:
        if A.find(c) == -1:
            ok = 0
    else:
        if B.find(c) == -1:
            ok = 0
print("Yes" if ok else "No")

Solution (Python):
S = input()

ans = "Yes"
for i, s in enumerate(S):
    if (i+1) %2 == 1:
        if s == 'R' or s == 'U' or s == 'D':
            pass
        else:
            ans = 'No'
            
            break
    else:
        if s == 'L' or s == 'U' or s == 'D':
            pass
        else:
            ans = 'No'

            break
print(ans)

Solution (Python):

N = input()
steps = [i for i in N]
N = len(N)
ans = "Yes"
for i in range(0,N,2):
    if steps[i] == "L":
        ans = "No"
for i in range(1,N,2):
    if steps[i] == "R":
        ans = "No"
print(ans)

Solution (Python):
s = input()

l = [ _ for _ in s ]

odd = set(['R','U','D'])
even = set(['L','U','D'])

l_odd = l[::2]
l_even = l[1::2]

s_odd = set(l_odd)
s_even = set(l_even)

if s_odd.issubset(odd) and s_even.issubset(even) :
	print('Yes')
else:
	print('No')

Solution (Python):
s=input()
test=0
i=0
n=len(s)
if n%2==0:
   while  i<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
else:
   while i+1<n:
      if s[i]=="L":
         test+=1
      if s[i+1]=="R":
         test+=1
      i+=2
   else:
      if s[i]=="L":
         test+=1
if test==0:
   print("Yes")
else:
   print("No")

Solution (Python):
import sys
S = input()
S_List = list(S)

S_o = S_List[0::2]

S_e = S_List[1::2]


for i in S_o:
    if(i != 'R' and i != 'U' and i != 'D'):

        print('No')
        sys.exit()

for i in S_e:
    if(i != 'L' and i != 'U' and i != 'D'):

        print('No')
        sys.exit()

print('Yes')

Solution (Python):
S = input()
a = len(S)
T = 0
b = 0

if a % 2 == 0:
  b = a // 2
  for i in range(b):
    if S[2*i] == 'L':
      T += 1    
  for i in range(b):
    if S[2*i+1] == 'R':
      T += 1

else:
  b = a // 2
  for i in range(b+1):
    if S[2*i] == 'L':
      T += 1
  for i in range(b):
    if S[2*i+1] == 'R':
      T += 1  

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

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

Solution (Python):
S = input()

countx = 0
county = 0

for x in range(0, len(S), 2):
    if S[x] != 'R' and S[x] != 'U' and S[x] != 'D':
        countx += 1
   
for y in range(1, len(S), 2):
    if S[y] != 'L' and S[y] != 'U' and S[y] != 'D':
        county += 1
        
print("Yes") if countx == 0 and county ==0 else print("No")

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

o = ['R','U','D']
e = ['L','U','D']
flag = 0
for idx ,i in enumerate(s):
  if (idx+1)%2 == 0 and not i in e:
    print('No')
    flag = 1
    break
  if (idx+1)%2 != 0 and not i in o:
    print('No')
    flag = 1
    break
if flag == 0:
  print('Yes')

Solution (Python):
s = input()
out = "No" if any(ss not in "RUD" for ss in s[::2]) or any(ss not in "LUD" for ss in s[1::2]) else "Yes"
print(out)

Solution (Python):
a=list()
b=list()
a="R", "U","D"
b="L", "U", "D"
s=input()
count=0
ans=True
for i in s:
    if count%2==0:
        if i not in a:
            ans=False
    if count%2!=0:
        if i not in b:
            ans=False
    count+=1

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

Solution (Python):

S = input()
s = list(S)

result = True

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

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

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

Solution (Python):
s = input()
if len(s) == 1:
    if s == "L":
        print("No")
    else:
        print("Yes")
else:
    for i in range(len(s)//2):
        if s[i*2] == "L" or s[1+i*2] == "R":
            print("No")
            break
    else:
        print("Yes")

Solution (Python):
S = input()


extract1 = S[::2]

odd = extract1.find("L")



extract2 = S[1::2]

even = extract2.find("R")

if odd == -1 and even == -1:
    print('Yes')

else:
    print("No")

Solution (Python):
n = list(input())
n.insert(0, 0)
if n.count("U") + n.count("D") == len(n):
    print("Yes")
else:
    count_l = 0
    count_r = 0
    for i in range(1, len(n)):
        if i % 2 == 0:
            if n[i] == 'R':
                count_r += 1
        if i % 2 != 0:
            if n[i] == 'L':
                count_l += 1
    print("No") if count_r > 0 or count_l > 0 else print("Yes")

Solution (Python):
S = input()
Ls = ['L', 'U', 'D'] 
Rs = ['R', 'U', 'D'] 
l = len(S)
n = l//2
f = True
S = 'R' + S
for i in range(1, n + 1):
    if (S[2*i - 1] in Rs) and (S[2*i] in Ls):
        pass
    else:
        f = False
        break
if f:
    if l%2 == 1:
        if S[-1] in Rs:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
else:
    print('No')

Solution (Python):


S = input()
evenstr =[S[i] for i in range(len(S)) if i % 2 == 0]
oddstr = [S[i] for i in range(len(S)) if i % 2 != 0]

for i in evenstr:
    if i in ['R','U','D']:
        jud = True
    else:
        jud = False
        break
if jud:
    for i in oddstr:
        if i in ['L','U','D']:
            jud = True
        else:
            jud = False
            break

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

Solution (Python):
T = ['L', 'R']
s = str(input())
S = [s[i:i+1] for i in range(0, len(s), 1)]

j = 0
for j in range(0, len(S)-1, 2):
    if (S[j] == T[0]) or (S[j+1] == T[1]):
        print('No')
        exit()
if (len(S) % 2 != 0) and (S[-1] == T[0]):
    print('No')
    exit()
print('Yes')

Solution (Python):
S = input()
S1 = S[::2]
S2 = S[1::2]
f = 1
for i in S1:
    if i in ['R', 'U', 'D']:
        f *= 1
    else:
        f *= 0
        
for i in S2:
    if i in ['L', 'U', 'D']:
        f *= 1
    else:
        f *= 0
if f:
    print('Yes')
else:
    print('No')

Solution (Python):
l=list(input())
l1=['U','D']
c=0
for i in range(len(l)):
    if l[i] not in l1:
        if (i+1)%2==0 and l[i]!='L':
            c=1
            break
        if (i+1)%2!=0 and l[i]!='R':
            c=1
            break
if(c==0):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
cnt = 0
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']
for i in range(len(S)):
    if i %2==0:
        if S[i] in odd:
            cnt +=1
    elif i %2==1:
        if S[i] in even:
            cnt +=1

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

Solution (Python):


S = input()
S_odd = list(S)[0::2]
S_even = list(S)[1::2]

if 'L' in S_odd or 'R' in S_even:
    print('No')
else:
    print('Yes')

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

Solution (Python):
s = input()

res = 'Yes'

for n,i in enumerate(s):
	if n % 2 == 1:
		if i == 'R':
			res = 'No'
	else:
		if i == 'L':
			res = 'No'

print(res)

Solution (Python):
s = list(input())
count = 0
add,even = ["R","U","D"],["L","U","D"]
for i in range(len(s)):
    if (i % 2 == 0) and (s[i] in add):
        count += 1
    elif (i % 2 == 1) and s[i] in even:
        count += 1
print("Yes" if count == len(s) else "No")

Solution (Python):
S = input()

count = 0
a = 0
b = 0
for i in range(len(S)):
    if count % 2 != 0:
        if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
            pass
        else:
            b -= 1
    else:
        if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
            pass
        else:
            a -=1

    count += 1

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

Solution (Python):
S = input()

flg = True
for i in range(len(S)):
    s = S[i]
    if (i+1) % 2 == 0:
        if s == 'R':
            flg = False
            break
    elif (i+1) % 2 == 1:
        if s == 'L':
            flg = False
            break
if flg:
    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
    if i %2==1:
        if s[i]== 'R':
            
            ans=1

if ans ==1:
    print('No')
if ans == 0:
    print('Yes')

Solution (Python):
s = str(raw_input())
no_flag = False
for i in range(len(s)):
  if i%2 == 0:
    if s[i] == 'L':
      print('No')
      no_flag = True
      break
  else:
    if s[i] == 'R':
      print('No')
      no_flag = True
      break
if no_flag == False:
  print('Yes')

Solution (Python):
S = input()

flag = True


for a in set(S[1::2]):
    if a == "R":
        flag = False
        break 
    

for b in set(S[::2]):
    if b == "L":
        flag = False
        break
        
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
S = str(input())
n = len(S)
sgn = [0]*n
for i in range(n):
    if (i%2) == 1:
        if S[i] == "L" or S[i] == "U" or S[i] == "D":
            sgn[i] = 0
        else:
            sgn[i] = 1
    if (i%2) == 0:
        if S[i] == "R" or S[i] == "U" or S[i] == "D":
            sgn[i] = 0
        else:
            sgn[i] = 1
if sum(sgn) == 0:
    print("Yes")
else:
    print("No")

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




list_S_even = [c for c in S[1::2]]
list_S_odd =  [c for c in S[::2]]




judge_aaa = True

for i in list_S_even:
    if i == "L" or i == "U" or i == "D":
        pass
    else:
        judge_aaa = False

for i in list_S_odd:
    if i == "R" or i == "U" or i == "D":
        pass
    else:
        judge_aaa = False

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

Solution (Python):
S = input()

Frag_1 = True
Frag_2 = True
for a in range(len(S)):
    if a % 2 == 0:

        if S[a] == "R" or S[a] =="U" or S[a] == "D":
            continue
        else:
            Frag_1 = False
    
    elif S[a] == "L" or S[a] =="U" or S[a] == "D":
        continue
    else:
        Frag_2 = False

if Frag_2 == True and Frag_1 == True:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s = input()
even = ['L', 'U', 'D']
odd = ['R', 'U', 'D']
flg = True
for i in range(len(s)):
  if i % 2 == 1:
    if s[i] not in even:
      flg = False
  else:
    if s[i] not in odd:
      flg = False
if flg:
  print('Yes')
else:
  print('No')

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

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

print(flag)

Solution (Python):
S = input()
output="Yes"
time=0
for step in S:
  time+=1
  if time%2==1 and step=="L":
    output=("No")
  elif time%2==0 and step=="R":
    output=("No")  
print(output)

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

odd = []
Even = []

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

ans = 'Yes'
for s in odd:
    if s == 'L':
        ans = 'No'
for s in Even:
    if s == 'R':
        ans = 'No'
print(ans)

Solution (Python):


S = input()
if S[0::2].find('L') == -1 and S[1::2].find('R') == -1:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys
str = input()
f = True
for s in str[0::2]:
    if s == "L":
       f = False
       break

if f == False:
    print("No")
    sys.exit()

for s in str[1::2]:
    if s == "R":
        f = False
        break

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

Solution (Python):
S = str(input())
ans="Yes"
for i, str in enumerate(S):
    if (i+1)%2==1:
        if not str=="R" and not str=="U" and not str=="D":
            ans="No"
    elif (i+1)%2==0:
        if not str=="L" and not str=="U" and not str=="D":
            ans="No"
print(ans)

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

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

Solution (Python):
s = input()
l=len(s)
flag = 1

for i in range(l):
    if i%2==0:
        if s[i] =='L':
            flag =0
            

    elif i%2==1:
        if s[i] =="R" :
            flag = 0
            

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

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

i = 0
for c in A:
    if i % 2 == 0 :
        
        if c != 'R' and c != 'U' and c != 'D':
            print('No')
            sys.exit()
    elif i % 2 == 1:
        if c != 'L' and c != 'U' and c != 'D':
            print('No')
            sys.exit()
    i+=1
print('Yes')

Solution (Python):

s = input()
flag_1 = [i for i, si in enumerate(s) if i%2 == 0 and (si =='R' or si=='U' or si=='D')]
flag_2 = [i for i, si in enumerate(s) if i%2 == 1 and (si =='L' or si=='U' or si=='D')]
if len(flag_1) + len(flag_2)==len(s):
    output = 'Yes'
else:
    output = 'No'
print('{}'.format(output))

Solution (Python):
import sys

S= list(input())

count =-1

flug =0

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

def solve(S: str):
    for i in range(len(S)):
        if i % 2 == 0:
            if not S[i] in odd:
                print(NO)
                sys.exit(0)
        else:
            if not S[i] in even:
                print(NO)
                sys.exit(0)
    print(YES)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

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

flag = True

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

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

n = len(s)
for i in s:
    count += 1
    if i == 'U' or i == 'D':
        count += 0
    elif count % 2 == 1:
        if i == 'L':
            print('No')
            break
    elif count % 2 == 0:
        if i == 'R':
            print('No')
            break
    if count == n:
        print('Yes')
        break

Solution (Python):
s = input()
odd_desired = set(["R", "U", "D"])
even_desired = set(["L", "U", "D"])
odd_actual = set(s[0::2])
even_actual = set(s[1::2])
if len(odd_actual - odd_desired) > 0 or len(even_actual - even_desired) > 0:
    print("No")
else:
    print("Yes")

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

for i, tmp in enumerate(s):
 if(i%2==0 and tmp == "L"):
  print("No")
  sys.exit()
 if(i%2!=0 and tmp == "R"):
  print("No")
  sys.exit()
print("Yes")

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

g_str = s[1::2]
k_str = s[0::2]

if "R" in g_str:
    print("No")
elif "L" in k_str:
    print("No")
else:
    print("Yes")

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

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

Solution (Python):
S = input()

def check( SS ):
    n = 0
    for i in SS:
        if n%2 == 0:
            if i != "R" and i != "U" and i != "D":
                return False
        elif n%2 == 1:
            if i != "L" and i != "U" and i != "D":
                return False
        n += 1
    return True


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

Solution (Python):

N = input()

str_list = list(N)

l = ["U", "D"]

r = "Yes"
for i, s in enumerate(str_list):

    if i == 0 or (i+1) % 2 != 0:
        if s == "R":
            continue
    else:
        if s == "L":
            continue

    if s not in l:
        r = "No"
        break

print(r)

Solution (Python):
s = input()

import sys

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        sys.exit(0)
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        sys.exit(0)
print('Yes')

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

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

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

Solution (Python):
S = input()

isEasy = True
for i, v in enumerate(S):
  if ((i + 1) % 2 == 0 and (v == 'L' or v == 'U' or v == 'D')):
    continue
  elif ((i + 1) % 2 == 1 and (v == 'R' or v == 'U' or v == 'D')):
    continue
  else:
    isEasy = False
    break
  
if isEasy:
  print('Yes')
else:
  print('No')

Solution (Python):
s = list(input())
ans = "Yes"
for i,c in enumerate(s):
    if (i+1) % 2 == 0:
        if c == "L" or c == "U" or c == "D":
            continue
        else:
            ans = "No"
            break
    else:
        if c == "R" or c == "U" or c == "D":
            continue
        else:
            ans = "No"
            break    
print(ans)

Solution (Python):
S = list(input())
k = 0 
for i in range(0, len(S)):
    if (i + 1) % 2 == 0:
        if S[i] in "LUD":
            k += 1
        else:
            print("No")
            exit()
    else:
        if S[i] in "RUD":
            k += 1
        else:
            print("No")
            exit()
if k >= 1:
    print("Yes")

Solution (Python):
import sys

oddEasySteps = ['R', 'U', 'D']
evenEasySteps = ['L', 'U', 'D']

steps = input()
oddSteps = steps[::2]
evenSteps = steps[1::2]

for step in oddSteps:
  if step not in oddEasySteps:
    print('No')
    sys.exit()

for step in evenSteps:
  if step not in evenEasySteps:
    print('No')
    sys.exit()

print('Yes')

Solution (Python):

import sys




import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    
    
    
    
    
    s = input()
    flag = False
    for i, x in enumerate(s):
        if i % 2 == 0:
            if x == "R" or x == "U" or x == "D":
                pass
            else:
                print("No")
                flag = True
                break
        else:
            if x == "L" or x == "U" or x == "D":
                pass
            else:
                print("No")
                flag = True
                break

    if not flag:
        print("Yes")


main()

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

Solution (Python):
def func() :
    s = input()
    for i in range(len(s)) :
        if i % 2 == 0 :
            if list(s)[i] == 'L' :
                return('No')
        else :
            if list(s)[i] == 'R' :
                return('No')
    return('Yes')
print(func())

Solution (Python):
def main():    
    S = raw_input()

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

    for i,c in enumerate(S):
        if i%2 ==0:
            if c in A:
                continue
        else:
            if c in B:
                continue
            
        print "No"
        return
    
    print "Yes"

main()

Solution (Python):


s = input()
slist = list(s)
no = 0

for i in range(len(slist)):
  w = slist[i]
  if i % 2 == 0:
    if w != 'R' and w != 'U' and w != 'D':
      no = 1
  else:
    if w != 'L' and w != 'U' and w != 'D':
      no = 1
      
if no == 0:
  print('Yes')
elif no == 1:
  print('No')
else:
  print('Error')

Solution (Python):
s = input()

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

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

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

    o = s[::2]
    e = s[1::2]

    for i in o:
        if i not in odd:
            return print("No")
    for i in e:
        if i not in even:
            return print("No")
    return print("Yes")

s = input()
tapdance(s)

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