#B
import sys
s = list(input())
one=["R", "U", "D"]
two=["L", "U", "D"]
for i in range(len(s)):
    if i % 2 == 0 and (one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i]):
        print("No")
        sys.exit()
    if i % 2 != 0 and(two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i]):
        print("No")
        sys.exit()
print('Yes') import sys sys s = list(input()) s list(input()) list input() input one=["R", "U", "D"] one ["R", "U", "D"] "R" "U" "D" two=["L", "U", "D"] two ["L", "U", "D"] "L" "U" "D" for i in range(len(s)):
    if i % 2 == 0 and (one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i]):
        print("No")
        sys.exit()
    if i % 2 != 0 and(two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i]):
        print("No")
        sys.exit() i range(len(s)) range len(s) len s if i % 2 == 0 and (one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i]):
        print("No")
        sys.exit()
     i % 2 == 0 and (one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i]) i % 2 == 0 i % 2 i 2 0 one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i] one[0] != s[i] and one[1]!=s[i] one[0] != s[i] one[0] one 0 s[i] s i one[1]!=s[i] one[1] one 1 s[i] s i one[2]!=s[i] one[2] one 2 s[i] s i print("No") print "No" sys.exit() sys.exit sys exit if i % 2 != 0 and(two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i]):
        print("No")
        sys.exit() i % 2 != 0 and(two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i]) i % 2 != 0 i % 2 i 2 0 two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i] two[0] != s[i] and two[1]!=s[i] two[0] != s[i] two[0] two 0 s[i] s i two[1]!=s[i] two[1] two 1 s[i] s i two[2]!=s[i] two[2] two 2 s[i] s i print("No") print "No" sys.exit() sys.exit sys exit print('Yes') print 'Yes' one=["R", "U", "D"] ["R", "U", "D"] one two=["L", "U", "D"] ["L", "U", "D"] two s = list(input()) list(input()) s
#B
import sys
s = list(input())
one=["R", "U", "D"]
two=["L", "U", "D"]
for i in range(len(s)):
    if i % 2 == 0 and (one[0] != s[i] and one[1]!=s[i] and one[2]!=s[i]):
        print("No")
        sys.exit()
    if i % 2 != 0 and(two[0] != s[i] and two[1]!=s[i] and two[2]!=s[i]):
        print("No")
        sys.exit()
print('Yes')