S = input()
a = "Yes"

if "L" in S[0::2] or "R" in S[1::2]:
  a = "No"

print(a) S = input() S input() input a = "Yes" a "Yes" if "L" in S[0::2] or "R" in S[1::2]:
  a = "No" "L" in S[0::2] or "R" in S[1::2] "L" in S[0::2] "L" S[0::2] S 0::2 0 2 "R" in S[1::2] "R" S[1::2] S 1::2 1 2 a = "No" a "No" print(a) print a S = input() input() S a = "Yes" "Yes" a a = "No" "No" a
S = input()
a = "Yes"

if "L" in S[0::2] or "R" in S[1::2]:
  a = "No"

print(a)