#include <iostream>
#include <string>
using namespace std;

bool solve(string s)
{
	int len = s.size();
	bool l = true, r = true;

	s+='!';

	for(int i=0; i<len; i++) {
		if(s[i]==s[i+1]) return false;

		if(s[i] == 'L' && i%2 == 1) l = false; 
		if(s[i] == 'R' && i%2 == 0) l = false;

		if(s[i] == 'L' && i%2 == 0) r = false; 
		if(s[i] == 'R' && i%2 == 1) r = false; 

	}

	return (l|r);
}

int main()
{
	int N;
	cin >> N;
	while(N--) {
		string s;
		cin >> s;

		cout << (solve(s)? "Yes":"No") << endl;
	
	}
}