s = [i for i in input()]
s_len = len(s)
list1 = []
list2 = []
for j in range(0, s_len, 2):
    for even in s[j]:
        list1.append(even in ['R', 'U', 'D'])
for k in range(1, s_len, 2):
    for odd in s[k]:
        list2.append(odd in ['L', 'U', 'D'])

if False in list1:
    print('No')
elif False in list2:
    print('No')
else:
    print('Yes') i for i in input() for i in input() i input() input for i in input() i s = [i for i in input()] s [i for i in input()] s_len = len(s) s_len len(s) len s list1 = [] list1 [] list2 = [] list2 [] for j in range(0, s_len, 2):
    for even in s[j]:
        list1.append(even in ['R', 'U', 'D']) j range(0, s_len, 2) range 0 s_len 2 for even in s[j]:
        list1.append(even in ['R', 'U', 'D']) even s[j] s j list1.append(even in ['R', 'U', 'D']) list1.append list1 append even in ['R', 'U', 'D'] even ['R', 'U', 'D'] 'R' 'U' 'D' for k in range(1, s_len, 2):
    for odd in s[k]:
        list2.append(odd in ['L', 'U', 'D']) k range(1, s_len, 2) range 1 s_len 2 for odd in s[k]:
        list2.append(odd in ['L', 'U', 'D']) odd s[k] s k list2.append(odd in ['L', 'U', 'D']) list2.append list2 append odd in ['L', 'U', 'D'] odd ['L', 'U', 'D'] 'L' 'U' 'D' if False in list1:
    print('No')
elif False in list2:
    print('No')
else:
    print('Yes') False in list1 False list1 print('No') print 'No' elif False in list2:
    print('No') False in list2 False list2 print('No') print 'No' print('Yes') print 'Yes' list1 = [] [] list1 s_len = len(s) len(s) s_len s = [i for i in input()] [i for i in input()] s list2 = [] [] list2
s = [i for i in input()]
s_len = len(s)
list1 = []
list2 = []
for j in range(0, s_len, 2):
    for even in s[j]:
        list1.append(even in ['R', 'U', 'D'])
for k in range(1, s_len, 2):
    for odd in s[k]:
        list2.append(odd in ['L', 'U', 'D'])

if False in list1:
    print('No')
elif False in list2:
    print('No')
else:
    print('Yes')
