s = input()

ans = True

for c in s[0::2]:
    if c not in {'R', 'U', 'D'}:
        ans = False
        break

for c in s[1::2]:
    if c not in {'L', 'U', 'D'}:
        ans = False
        break

if ans:
    print('Yes')
else:
    print('No') s = input() s input() input ans = True ans True for c in s[0::2]:
    if c not in {'R', 'U', 'D'}:
        ans = False
        break c s[0::2] s 0::2 0 2 if c not in {'R', 'U', 'D'}:
        ans = False
        break c not in {'R', 'U', 'D'} c {'R', 'U', 'D'} ans = False ans False break for c in s[1::2]:
    if c not in {'L', 'U', 'D'}:
        ans = False
        break c s[1::2] s 1::2 1 2 if c not in {'L', 'U', 'D'}:
        ans = False
        break c not in {'L', 'U', 'D'} c {'L', 'U', 'D'} ans = False ans False break if ans:
    print('Yes')
else:
    print('No') ans print('Yes') print 'Yes' print('No') print 'No' ans = True True ans ans = False False ans s = input() input() s ans = False False ans
s = input()

ans = True

for c in s[0::2]:
    if c not in {'R', 'U', 'D'}:
        ans = False
        break

for c in s[1::2]:
    if c not in {'L', 'U', 'D'}:
        ans = False
        break

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