#include <iostream>
#include <string>

using namespace std;

string str;

bool check(char l, char r){
  if(l == ' ' || r == ' ') return true;
  if(l == 'R' || r == 'L') return false;
  return true;
}

bool solve(int turn){
  char pre = ' ';
  char step[2] = {' ', ' '};
  for(int i=0;i<str.size();i++){
    if(pre == str[i]) return false;
    step[turn] = str[i];
    if(!check(step[0], step[1])) return false;
    turn = 1 - turn;
    pre = str[i];
  }
  return true;
}

int main(){
  int tc;
  cin >> tc;
  while(tc--){
    cin >> str;
    cout << (solve(0) || solve(1) ? "Yes" : "No") << endl;
  }
}