# -*- coding: utf-8 -*-

s = list(input())

for i, posi in enumerate(s):
    num = i+1
    if num % 2 == 0 and posi == 'R':
        print('No')
        exit(0)
    elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0)

print('Yes') s = list(input()) s list(input()) list input() input for i, posi in enumerate(s):
    num = i+1
    if num % 2 == 0 and posi == 'R':
        print('No')
        exit(0)
    elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0) i posi enumerate(s) enumerate s num = i+1 num i+1 i 1 if num % 2 == 0 and posi == 'R':
        print('No')
        exit(0)
    elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0) num % 2 == 0 and posi == 'R' num % 2 == 0 num % 2 num 2 0 posi == 'R' posi 'R' print('No') print 'No' exit(0) exit 0 elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0) num % 2 != 0 and posi == 'L' num % 2 != 0 num % 2 num 2 0 posi == 'L' posi 'L' print('No') print 'No' exit(0) exit 0 print('Yes') print 'Yes' s = list(input()) list(input()) s num = i+1 i+1 num
# -*- coding: utf-8 -*-

s = list(input())

for i, posi in enumerate(s):
    num = i+1
    if num % 2 == 0 and posi == 'R':
        print('No')
        exit(0)
    elif num % 2 != 0 and posi == 'L':
        print('No')
        exit(0)

print('Yes')
