B. Move-a-coin-2
time limit per test
4 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Example
Input
3
R
D
L
U
Output
YES
4
R
D
L
R