S_list = list(input())

for i in range(0, len(S_list), 2):
    if S_list[i] == 'R' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit()

for i in range(1, len(S_list), 2):
    if S_list[i] == 'L' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit()

print('Yes') S_list = list(input()) S_list list(input()) list input() input for i in range(0, len(S_list), 2):
    if S_list[i] == 'R' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit() i range(0, len(S_list), 2) range 0 len(S_list) len S_list 2 if S_list[i] == 'R' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit() S_list[i] == 'R' or S_list[i] == 'U' or S_list[i] == 'D' S_list[i] == 'R' or S_list[i] == 'U' S_list[i] == 'R' S_list[i] S_list i 'R' S_list[i] == 'U' S_list[i] S_list i 'U' S_list[i] == 'D' S_list[i] S_list i 'D' print('No') print 'No' exit() exit for i in range(1, len(S_list), 2):
    if S_list[i] == 'L' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit() i range(1, len(S_list), 2) range 1 len(S_list) len S_list 2 if S_list[i] == 'L' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit() S_list[i] == 'L' or S_list[i] == 'U' or S_list[i] == 'D' S_list[i] == 'L' or S_list[i] == 'U' S_list[i] == 'L' S_list[i] S_list i 'L' S_list[i] == 'U' S_list[i] S_list i 'U' S_list[i] == 'D' S_list[i] S_list i 'D' print('No') print 'No' exit() exit print('Yes') print 'Yes' S_list = list(input()) list(input()) S_list
S_list = list(input())

for i in range(0, len(S_list), 2):
    if S_list[i] == 'R' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit()

for i in range(1, len(S_list), 2):
    if S_list[i] == 'L' or S_list[i] == 'U' or S_list[i] == 'D':
        pass
    else:
        print('No')
        exit()

print('Yes')
