#include <iostream>
#include <string>
#include <cstdio>

using namespace std;
#define loop(i,a,b) for(int i=a; i<int(b); i++)
#define rep(i,a) loop(i,0,a)

bool chk(string &s){
    bool l=true, r=true;
    char last='a';
    rep(i,s.size()){
        if(s[i]==last)return false;
        last = s[i];
        if((i%2==0 && s[i]=='R') || (i%2!=0 && s[i]=='L')) l = false;
        if((i%2==0 && s[i]=='L') || (i%2!=0 && s[i]=='R')) r = false;
        if(!l && !r)return false;
    }
    return true;
}

int main(){
    int n; cin>>n;
    rep(i,n){
        string s;cin>>s;
        puts(chk(s) ? "Yes" : "No");
    }
}