S=list(str(input()))
a=[]
for i in range(len(S)):
    if (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    else:
        a.append('No')
if 'No' in a:
    print('No')
else:
    print('Yes') S=list(str(input())) S list(str(input())) list str(input()) str input() input a=[] a [] for i in range(len(S)):
    if (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    else:
        a.append('No') i range(len(S)) range len(S) len S if (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    else:
        a.append('No') (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D') (i+1)%2==0 (i+1)%2 i+1 i 1 2 0 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' a.append('Yes') a.append a append 'Yes' elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
     (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D') (i+1)%2==1 (i+1)%2 i+1 i 1 2 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' a.append('Yes') a.append a append 'Yes' a.append('No') a.append a append 'No' if 'No' in a:
    print('No')
else:
    print('Yes') 'No' in a 'No' a print('No') print 'No' print('Yes') print 'Yes' a=[] [] a S=list(str(input())) list(str(input())) S
S=list(str(input()))
a=[]
for i in range(len(S)):
    if (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    else:
        a.append('No')
if 'No' in a:
    print('No')
else:
    print('Yes')