s = input()

odd_s = list(s[0::2])
even_s = list(s[1::2])

to = ['R', 'U', 'D']
te = ['L', 'U', 'D']

if set(odd_s).issubset(to) and set(even_s).issubset(te):
    print('Yes')
else:
    print('No') s = input() s input() input odd_s = list(s[0::2]) odd_s list(s[0::2]) list s[0::2] s 0::2 0 2 even_s = list(s[1::2]) even_s list(s[1::2]) list s[1::2] s 1::2 1 2 to = ['R', 'U', 'D'] to ['R', 'U', 'D'] 'R' 'U' 'D' te = ['L', 'U', 'D'] te ['L', 'U', 'D'] 'L' 'U' 'D' if set(odd_s).issubset(to) and set(even_s).issubset(te):
    print('Yes')
else:
    print('No') set(odd_s).issubset(to) and set(even_s).issubset(te) set(odd_s).issubset(to) (odd_s).issubset (odd_s) set odd_s issubset to set(even_s).issubset(te) (even_s).issubset (even_s) set even_s issubset te print('Yes') print 'Yes' print('No') print 'No' te = ['L', 'U', 'D'] ['L', 'U', 'D'] te s = input() input() s to = ['R', 'U', 'D'] ['R', 'U', 'D'] to odd_s = list(s[0::2]) list(s[0::2]) odd_s even_s = list(s[1::2]) list(s[1::2]) even_s
s = input()

odd_s = list(s[0::2])
even_s = list(s[1::2])

to = ['R', 'U', 'D']
te = ['L', 'U', 'D']

if set(odd_s).issubset(to) and set(even_s).issubset(te):
    print('Yes')
else:
    print('No')
