t=input()
ans = ""
for i in range(len(t)):
    if (i % 2 == 1) and (t[i] == "R"):
        ans = "No"
        break
    elif (i % 2 == 0) and (t[i] == "L"):
        ans = "No"
        break

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

if ans == "No":
    print("No")
else:
    print("Yes")
