list_s = list(input())
for i in range(0, len(list_s)):
    if list_s[i] == 'U' or list_s[i] == 'D': continue
    elif (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L'): continue
    else: print("No")
    exit()
print("Yes") list_s = list(input()) list_s list(input()) list input() input for i in range(0, len(list_s)):
    if list_s[i] == 'U' or list_s[i] == 'D': continue
    elif (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L'): continue
    else: print("No")
    exit() i range(0, len(list_s)) range 0 len(list_s) len list_s if list_s[i] == 'U' or list_s[i] == 'D': continue
    elif (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L'): continue
    else: print("No")
     list_s[i] == 'U' or list_s[i] == 'D' list_s[i] == 'U' list_s[i] list_s i 'U' list_s[i] == 'D' list_s[i] list_s i 'D' elif (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L'): continue
     (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L') i % 2 == 0 and list_s[i] == 'R' i % 2 == 0 i % 2 i 2 0 list_s[i] == 'R' list_s[i] list_s i 'R' i % 2 != 0 and list_s[i] == 'L' i % 2 != 0 i % 2 i 2 0 list_s[i] == 'L' list_s[i] list_s i 'L' exit() exit print("Yes") print "Yes" list_s = list(input()) list(input()) list_s
list_s = list(input())
for i in range(0, len(list_s)):
    if list_s[i] == 'U' or list_s[i] == 'D': continue
    elif (i % 2 == 0 and list_s[i] == 'R') or (i % 2 != 0 and list_s[i] == 'L'): continue
    else: print("No")
    exit()
print("Yes")