S = input()
ki = 'RUD'
gu = 'LUD'
for i, s in enumerate(S):
    if i%2 == 0:
        if s not in ki:
            print('No')
            exit()
    else:
        if s not in gu:
            print('No')
            exit()
print('Yes') S = input() S input() input ki = 'RUD' ki 'RUD' gu = 'LUD' gu 'LUD' for i, s in enumerate(S):
    if i%2 == 0:
        if s not in ki:
            print('No')
            exit()
    else:
        if s not in gu:
            print('No')
            exit() i s enumerate(S) enumerate S if i%2 == 0:
        if s not in ki:
            print('No')
            exit()
    else:
        if s not in gu:
            print('No')
            exit() i%2 == 0 i%2 i 2 0 if s not in ki:
            print('No')
            exit()
     s not in ki s ki print('No') print 'No' exit() exit if s not in gu:
            print('No')
            exit() s not in gu s gu print('No') print 'No' exit() exit print('Yes') print 'Yes' S = input() input() S ki = 'RUD' 'RUD' ki gu = 'LUD' 'LUD' gu
S = input()
ki = 'RUD'
gu = 'LUD'
for i, s in enumerate(S):
    if i%2 == 0:
        if s not in ki:
            print('No')
            exit()
    else:
        if s not in gu:
            print('No')
            exit()
print('Yes')