#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 100000

static int n;
static char d[ N + 1 ];
static size_t l;

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int i;

  scanf ( "%d", &n );
  while ( n-- )
  {
    scanf ( " %s", d );
    l = strlen ( d );

    /* 連続判定 */
    for ( i = 1; i < l; ++i )
    {
      if ( d[ i - 1 ] == d[ i ] )
        goto FAIL;
    }

    /* 公差判定 */
    for ( i = 0; i < l; ++i )
    {
      switch ( d[ i ] )
      {
        case 'R': d[ i ] = 0; break ;
        case 'U': d[ i ] = 1; break ;
        case 'D': d[ i ] = 1; break ;
        case 'L': d[ i ] = 2; break ;
      }
    }
TEST1:
    for ( i = 1; i < l; i += 2 )
    {
      if ( d[ i - 1 ] > d[ i ] )
        goto TEST2;
    }
    goto SUCC;
TEST2:
    for ( i = 1; i < l; i += 2 )
    {
      if ( d[ i - 1 ] > d[ i ] )
        goto FAIL;
    }
    goto SUCC;

FAIL:
    puts ( "No" );
    continue ;
SUCC:
    puts ( "Yes" );
  }

  return ( EXIT_SUCCESS );
}