var data = require('fs').readFileSync('/dev/stdin', 'utf8');
var input = data.trim().split("\n");
var n = input.shift();
for (var i = 0; i < n; i++) {
    var dataset = input[i].split(/\s+/);

    console.log(scores(dataset) ? "Yes" : "No");
}

function scores(dataset) {
    var left = true;
    var right = true;
    dataset += '!';
    for (var i = 0; i < dataset.length; i++) {
        if (dataset[i] == dataset[i + 1])
            return false;
        if (dataset[i] == 'L' && i % 2 == 1)
            left = false;
        if (dataset[i] == 'R' && i % 2 == 0)
            left = false;
        if (dataset[i] == 'L' && i % 2 == 0)
            right = false;
        if (dataset[i] == 'R' && i % 2 == 1)
            right = false;
    }

    return (left | right);
}