s=input()
i=0
flag=0
while i<len(s):
    if (i+1)%2==0:
        if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
         
    else:
        if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
     

    if flag==1:
        break


    i+=1

if flag==1:
    print("No")
else:
    print("Yes") s=input() s input() input i=0 i 0 flag=0 flag 0 while i<len(s):
    if (i+1)%2==0:
        if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
         
    else:
        if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
     

    if flag==1:
        break


    i+=1 i<len(s) i len(s) len s if (i+1)%2==0:
        if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
         
    else:
        if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
     

     (i+1)%2==0 (i+1)%2 i+1 i 1 2 0 if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=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" flag+=1 flag 1 if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=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" flag+=1 flag 1 if flag==1:
        break


     flag==1 flag 1 break i+=1 i 1 if flag==1:
    print("No")
else:
    print("Yes") flag==1 flag 1 print("No") print "No" print("Yes") print "Yes" flag=0 0 flag flag+=1 1 flag i=0 0 i flag+=1 1 flag s=input() input() s i+=1 1 i
s=input()
i=0
flag=0
while i<len(s):
    if (i+1)%2==0:
        if s[i] =="L" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
         
    else:
        if s[i] =="R" or s[i] =="U" or s[i] =="D":
            pass
        else:
            flag+=1
     

    if flag==1:
        break


    i+=1

if flag==1:
    print("No")
else:
    print("Yes")