s = str(input())

for i in range(len(s)):
    #print(s[i])
    if i%2 == 0:        #偶数
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    elif i%2 == 1:       #奇数
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    

print('Yes') s = str(input()) s str(input()) str input() input for i in range(len(s)):
    #print(s[i])
    if i%2 == 0:        #偶数
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    elif i%2 == 1:       #奇数
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
     i range(len(s)) range len(s) len s if i%2 == 0:        #偶数
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    elif i%2 == 1:       #奇数
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
     i%2 == 0 i%2 i 2 0 if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
     s[i] != 'R' and s[i] != 'U' and s[i] != 'D' s[i] != 'R' and 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' print('No') print 'No' exit() exit elif i%2 == 1:       #奇数
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
     i%2 == 1 i%2 i 2 1 if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
     s[i] != 'L' and s[i] != 'U' and s[i] != 'D' s[i] != 'L' and 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' print('No') print 'No' exit() exit print('Yes') print 'Yes' s = str(input()) str(input()) s
s = str(input())

for i in range(len(s)):
    #print(s[i])
    if i%2 == 0:        #偶数
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    elif i%2 == 1:       #奇数
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            print('No')
            exit()
    

print('Yes')