#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;

int main(){
  int n; cin>>n;
  string s;
  REP(i,n){
    cin>>s;
    bool ok = true;
    REP(i,s.size()-1)if(s[i]==s[i+1])ok = false;
    bool t[2]={};
    REP(i,s.size()){
      if(s[i]=='L')t[(i+0)%2] = true;
      else if(s[i]=='R')t[(i+1)%2] = true;
    }
    if(t[0]&&t[1])ok = false;
    if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}