s=input()
for i in range(len(s)):
    if i%2==0:
        if s[i] in 'RUD':
            continue
        else:
            print('No')
            break
    else:
        if s[i] in 'LUD':
            continue
        else:
            print('No')
            break
else:
    print('Yes') s=input() s input() input for i in range(len(s)):
    if i%2==0:
        if s[i] in 'RUD':
            continue
        else:
            print('No')
            break
    else:
        if s[i] in 'LUD':
            continue
        else:
            print('No')
            break
else:
    print('Yes') i range(len(s)) range len(s) len s if i%2==0:
        if s[i] in 'RUD':
            continue
        else:
            print('No')
            break
    else:
        if s[i] in 'LUD':
            continue
        else:
            print('No')
            break i%2==0 i%2 i 2 0 if s[i] in 'RUD':
            continue
        else:
            print('No')
            break
     s[i] in 'RUD' s[i] s i 'RUD' continue print('No') print 'No' break if s[i] in 'LUD':
            continue
        else:
            print('No')
            break s[i] in 'LUD' s[i] s i 'LUD' continue print('No') print 'No' break print('Yes') print 'Yes' s=input() input() s
s=input()
for i in range(len(s)):
    if i%2==0:
        if s[i] in 'RUD':
            continue
        else:
            print('No')
            break
    else:
        if s[i] in 'LUD':
            continue
        else:
            print('No')
            break
else:
    print('Yes')