#include <bits/stdc++.h>
#define fo(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define ll long long
//#define file
using namespace std;

int T,n,i,j,k,l,L,R,Mid,s;
int a[300001],f[300001],g[300001],ls[300001],p[19];
int ans[300001];

namespace st{
	int f[300001][19],i,j,k,l;
	void init()
	{
		fo(i,1,n) f[i][0]=a[i]+i;k=1;
		fo(l,1,18)
		{
			fo(i,1,n-k*2+1) f[i][l]=max(f[i][l-1],f[i+k][l-1]);
			k*=2;
		}
	}
	int get(int x,int y)
	{
		int len=y-x+1,l=floor(log2(len));
		return max(f[x][l],f[y-p[l]+1][l]);
	}
}

int main()
{
	#ifdef file
	freopen("CF1476F.in","r",stdin);
	#endif
	
	p[0]=1;
	fo(i,1,18) p[i]=p[i-1]*2;
	scanf("%d",&T);
	for (;T;--T)
	{
		scanf("%d",&n);
		memset(f,0,(n+1)*4);
		fo(i,1,n) scanf("%d",&a[i]);
		st::init();
		
		fo(i,1,n)
		{
			f[i]=f[i-1],g[i]=1,ls[i]=i-1;
			if (f[i-1]>=i) {if (i+a[i]>f[i]) f[i]=max(f[i],i+a[i]),g[i]=1,ls[i]=i-1;}
			
			if (f[i-1]+1>=i-a[i]) {if (i-1>f[i]) f[i]=max(f[i],i-1),g[i]=0,ls[i]=i-1;}
			L=0,R=i-1;
			while (L<R)
			{
				Mid=(L+R)/2;
				if (f[Mid]+1<i-a[i]) L=Mid+1; else R=Mid;
			}
			j=L;
			if (j+1<=i-1)
			{
				s=st::get(j+1,i-1);
				if (s>f[i]) f[i]=max(f[i],s),g[i]=0,ls[i]=j;
			}
		}
		
		if (f[n]<n) printf("NO\n");
		else
		{
			printf("YES\n");
			fo(i,1,n) ans[i]=1;
			for (i=n; i; i=ls[i]) ans[i]=g[i];
			fo(i,1,n) putchar(!ans[i]?'L':'R');putchar('\n');
		}
	}
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}