n = gets.to_i
n.times do
  s = gets.to_s
  ck = true
  t = 1
  for i in 0..s.size-1
    if s[i]=='R'
      if i%2==0
        t=1;
      else 
        t=-1
      end
    elsif s[i]=='L'
      if i%2==0
        t=-1
      else
        t=1
      end
    end
  end
  for i in 1..s.size-1
    if t==1
      ck = false if s[i]=='R'
    else 
      ck = false if s[i]=='L'
    end
    ck = false if s[i-1]==s[i]
    t = -t
  end
  if ck
    puts "Yes"
  else 
    puts "No"
  end
end
