s = str(input())
isError = False
for i in range(len(s)):
    if i%2==0:
        if s[i]=='L':
            isError = True
    else:
        if s[i]=='R':
            isError = True
if isError:
    print('No')
else:
    print('Yes') s = str(input()) s str(input()) str input() input isError = False isError False for i in range(len(s)):
    if i%2==0:
        if s[i]=='L':
            isError = True
    else:
        if s[i]=='R':
            isError = True i range(len(s)) range len(s) len s if i%2==0:
        if s[i]=='L':
            isError = True
    else:
        if s[i]=='R':
            isError = True i%2==0 i%2 i 2 0 if s[i]=='L':
            isError = True
     s[i]=='L' s[i] s i 'L' isError = True isError True if s[i]=='R':
            isError = True s[i]=='R' s[i] s i 'R' isError = True isError True if isError:
    print('No')
else:
    print('Yes') isError print('No') print 'No' print('Yes') print 'Yes' isError = True True isError s = str(input()) str(input()) s isError = True True isError isError = False False isError
s = str(input())
isError = False
for i in range(len(s)):
    if i%2==0:
        if s[i]=='L':
            isError = True
    else:
        if s[i]=='R':
            isError = True
if isError:
    print('No')
else:
    print('Yes')
