s = input()
diff = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
    if i % 2 == 1:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
if diff == 0:
    print("Yes")
else:
    print("No") s = input() s input() input diff = 0 diff 0 for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
    if i % 2 == 1:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1 i range(len(s)) range len(s) len s if i % 2 == 0:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
     i % 2 == 0 i % 2 i 2 0 if s[i] == "R" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
     s[i] == "R" or s[i] == "U" or s[i] == "D" s[i] == "R" or s[i] == "U" s[i] == "R" s[i] s i "R" s[i] == "U" s[i] s i "U" s[i] == "D" s[i] s i "D" continue diff += 1 diff 1 if i % 2 == 1:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1 i % 2 == 1 i % 2 i 2 1 if s[i] == "L" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1 s[i] == "L" or s[i] == "U" or s[i] == "D" s[i] == "L" or s[i] == "U" s[i] == "L" s[i] s i "L" s[i] == "U" s[i] s i "U" s[i] == "D" s[i] s i "D" continue diff += 1 diff 1 if diff == 0:
    print("Yes")
else:
    print("No") diff == 0 diff 0 print("Yes") print "Yes" print("No") print "No" s = input() input() s diff += 1 1 diff diff = 0 0 diff diff += 1 1 diff
s = input()
diff = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
    if i % 2 == 1:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            continue
        else:
            diff += 1
if diff == 0:
    print("Yes")
else:
    print("No")