S = list(input())
S_odd = [s for i, s in enumerate(S) if i % 2 == 0]
S_even = [s for i, s in enumerate(S) if i % 2 != 0]
if 'L' in S_odd or 'R' in S_even:
    print('No')
else:
    print('Yes') S = list(input()) S list(input()) list input() input s for i, s in enumerate(S) if i % 2 == 0 for i, s in enumerate(S) if i % 2 == 0 i s enumerate(S) enumerate S i % 2 == 0 i % 2 i 2 0 if i % 2 == 0 s S_odd = [s for i, s in enumerate(S) if i % 2 == 0] S_odd [s for i, s in enumerate(S) if i % 2 == 0] s for i, s in enumerate(S) if i % 2 != 0 for i, s in enumerate(S) if i % 2 != 0 i s enumerate(S) enumerate S i % 2 != 0 i % 2 i 2 0 if i % 2 != 0 s S_even = [s for i, s in enumerate(S) if i % 2 != 0] S_even [s for i, s in enumerate(S) if i % 2 != 0] if 'L' in S_odd or 'R' in S_even:
    print('No')
else:
    print('Yes') 'L' in S_odd or 'R' in S_even 'L' in S_odd 'L' S_odd 'R' in S_even 'R' S_even print('No') print 'No' print('Yes') print 'Yes' S_odd = [s for i, s in enumerate(S) if i % 2 == 0] [s for i, s in enumerate(S) if i % 2 == 0] S_odd S_even = [s for i, s in enumerate(S) if i % 2 != 0] [s for i, s in enumerate(S) if i % 2 != 0] S_even S = list(input()) list(input()) S
S = list(input())
S_odd = [s for i, s in enumerate(S) if i % 2 == 0]
S_even = [s for i, s in enumerate(S) if i % 2 != 0]
if 'L' in S_odd or 'R' in S_even:
    print('No')
else:
    print('Yes')