s = input()

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] == "L":
        print("No")
        break
    elif (i + 1) % 2 == 0 and s[i] == "R":
        print("No")
        break
else:
    print("Yes") s = input() s input() input for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] == "L":
        print("No")
        break
    elif (i + 1) % 2 == 0 and s[i] == "R":
        print("No")
        break
else:
    print("Yes") i range(len(s)) range len(s) len s if (i + 1) % 2 == 1 and s[i] == "L":
        print("No")
        break
    elif (i + 1) % 2 == 0 and s[i] == "R":
        print("No")
        break (i + 1) % 2 == 1 and s[i] == "L" (i + 1) % 2 == 1 (i + 1) % 2 i + 1 i 1 2 1 s[i] == "L" s[i] s i "L" print("No") print "No" break elif (i + 1) % 2 == 0 and s[i] == "R":
        print("No")
        break (i + 1) % 2 == 0 and s[i] == "R" (i + 1) % 2 == 0 (i + 1) % 2 i + 1 i 1 2 0 s[i] == "R" s[i] s i "R" print("No") print "No" break print("Yes") print "Yes" s = input() input() s
s = input()

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] == "L":
        print("No")
        break
    elif (i + 1) % 2 == 0 and s[i] == "R":
        print("No")
        break
else:
    print("Yes")