import re





def inpl():

    return list(map(int, input().split()))





S = eval(input())



p = re.compile(r'([^L][^R])*[^L]?$')



if p.match(S):

    print('Yes')

else:

    print('No')
import re





def inpl():

    return list(map(int, input().split()))





S = eval(input())



p = re.compile(r'^([^L][^R])*[^L]?$')



if p.match(S):

    print('Yes')

else:

    print('No')
import re


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


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

import re


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


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

-p = re.compile(r"([^L][^R])*[^L]?$") +p = re.compile(r"^([^L][^R])*[^L]?$")